mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-09 09:00:58 +00:00
Merge pull request #272 from cjmayo/python3_22
{python3_22} Python3: fix decode_parts function
This commit is contained in:
commit
bb573e5eb1
1 changed files with 5 additions and 2 deletions
|
|
@ -350,11 +350,14 @@ def url_norm (url, encoding=None):
|
|||
urlparts[2] = url_fix_wayback_query(urlparts[2]) # unencode colon in http[s]:// in wayback path
|
||||
urlparts[4] = url_quote_part(urlparts[4], safechars="!$&'()*+,-./;=?@_~", encoding=encoding) # anchor
|
||||
res = urlunsplit(urlparts)
|
||||
if url.endswith('#') and not urlparts[4]:
|
||||
if decode_for_unquote(url).endswith('#') and not urlparts[4]:
|
||||
# re-append trailing empty fragment
|
||||
res += '#'
|
||||
if encode_unicode:
|
||||
res = unicode(res)
|
||||
try:
|
||||
res = unicode(res)
|
||||
except NameError:
|
||||
pass
|
||||
return (res, is_idn)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue