[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

samwyse report at bugs.python.org
Sat Jul 14 12:52:16 CEST 2012


samwyse <samwyse at gmail.com> added the comment:

Since no one else seems willing to do it, here's a patch that adds a 'quote_via' keyword parameter to the urlencode function.

>>> import urllib.parse
>>> query={"foo": "+ "}
>>> urllib.parse.urlencode(query)
'foo=%2B+'
>>> urllib.parse.urlencode(query, quote_via=urllib.parse.quote)
'foo=%2B%20'

----------
keywords: +patch
Added file: http://bugs.python.org/file26378/urllib_parse.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13866>
_______________________________________


More information about the Python-bugs-list mailing list