[docs] [issue22618] urllib.parse.parse_qsl different results after urllib.parse.unquote

R. David Murray report at bugs.python.org
Sun Oct 12 16:56:53 CEST 2014


R. David Murray added the comment:

Isn't it obvious that you have to parse before you unquote?  That's the purpose of quoting, after all.  I suppose that is one of those "beginner mind" things that is obvious only because I'm an experienced programmer...and that there are web servers that do it wrong. 

The docs could definitely use some improvement, since they don't mention that parse_qs automatically unquotes the values...it is implicit in the fact that urlencode with doseq=true is the inverse, and it encodes them, but it should be made explicit.

You also might want to take note of the 'keep_blank_values' attribute, which could also use a doc improvement (it isn't obvious from the text what 'blank values' are):

>>> parse_qs('a=1&b=2&b=1&a%3Donly_appears_after_unquote', keep_blank_values=True)
{'a': ['1'], 'b': ['2', '1'], 'a=only_appears_after_unquote': ['']}

----------
assignee:  -> docs at python
components: +Documentation -Library (Lib)
nosy: +docs at python, r.david.murray
versions: +Python 2.7, Python 3.5

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


More information about the docs mailing list