[minor] Unicode issue in quote url
This commit is contained in:
parent
e1089d1f2d
commit
08d94920f6
1 changed files with 1 additions and 1 deletions
|
|
@ -580,7 +580,7 @@ def expand_relative_urls(html):
|
|||
def quote_urls(html):
|
||||
def _quote_url(match):
|
||||
groups = list(match.groups())
|
||||
groups[2] = urllib.quote(groups[2], safe="~@#$&()*!+=:;,.?/'")
|
||||
groups[2] = urllib.quote(groups[2].encode("utf-8"), safe=b"~@#$&()*!+=:;,.?/'").decode("utf-8")
|
||||
return "".join(groups)
|
||||
return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)',
|
||||
_quote_url, html)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue