mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-22 23:24:44 +00:00
Catch KeyError when quoting URLs of index.html.
This commit is contained in:
parent
4678802a81
commit
c086f49cea
1 changed files with 5 additions and 1 deletions
|
|
@ -121,7 +121,11 @@ def get_index_html (urls):
|
|||
lines = ["<html>", "<body>"]
|
||||
for entry in urls:
|
||||
name = cgi.escape(entry)
|
||||
url = cgi.escape(urllib.quote(entry))
|
||||
try:
|
||||
url = cgi.escape(urllib.quote(entry))
|
||||
except KeyError:
|
||||
# Some unicode entries raise KeyError.
|
||||
url = name
|
||||
lines.append('<a href="%s">%s</a>' % (url, name))
|
||||
lines.extend(["</body>", "</html>"])
|
||||
return os.linesep.join(lines)
|
||||
|
|
|
|||
Loading…
Reference in a new issue