[issue35041] urllib.parse.quote safe Parameter Not Optional

Ammar Askar report at bugs.python.org
Sun Oct 21 23:57:54 EDT 2018


Ammar Askar <ammar at ammaraskar.com> added the comment:

I agree that 

urllib.parse.quote("/", safe=['/'])

should probably work. It looks like the reason it doesn't is because quote tries to normalize the safe iterable to ASCII characters only. As part of this it attempts to run `< 128` on each element of safe.

As part of this it does

'/' < 128

and fails.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35041>
_______________________________________


More information about the Python-bugs-list mailing list