Another just in case update for an Issue #1011

This commit is contained in:
Miroslav Stampar 2014-12-11 00:14:35 +01:00
parent 763f720675
commit 2bcaae3a0b

View File

@ -1264,7 +1264,7 @@ def parseTargetUrl():
try:
_ = conf.hostname.encode("idna")
except LookupError:
_ = conf.hostname
_ = conf.hostname.encode(UNICODE_ENCODING)
except UnicodeError:
_ = None
@ -3385,7 +3385,10 @@ def asciifyUrl(url, forceQuote=False):
return url
# idna-encode domain
hostname = parts.hostname.encode("idna")
try:
hostname = parts.hostname.encode("idna")
except LookupError:
hostname = parts.hostname.encode(UNICODE_ENCODING)
# UTF8-quote the other parts. We check each part individually if
# if needs to be quoted - that should catch some additional user