diff --git a/linkcheck/checker/__init__.py b/linkcheck/checker/__init__.py index a47f45c3..3e6591ea 100644 --- a/linkcheck/checker/__init__.py +++ b/linkcheck/checker/__init__.py @@ -19,7 +19,7 @@ Main functions for link checking. """ import os -import cgi +from html import escape as html_escape try: # Python 3 from urllib import parse as urlparse except ImportError: @@ -166,9 +166,9 @@ def get_index_html (urls): """ lines = ["", "
"] for entry in urls: - name = cgi.escape(entry) + name = html_escape(entry) try: - url = cgi.escape(urlparse.quote(entry)) + url = html_escape(urlparse.quote(entry)) except KeyError: # Some unicode entries raise KeyError. url = name diff --git a/linkcheck/lc_cgi.py b/linkcheck/lc_cgi.py index 95ccc821..e3b12478 100644 --- a/linkcheck/lc_cgi.py +++ b/linkcheck/lc_cgi.py @@ -18,7 +18,7 @@ Functions used by the WSGI script. """ -import cgi +from html import escape as html_escape import os import threading import locale @@ -265,4 +265,4 @@ contains only these characters:A-Za-z0-9./_~-