Martin Panter added the comment:
1. urlencode(): I agree the documentation is unclear. But David Rueter’s
suggestion does not help much. I think doseq=True is meant to also work for a
mapping query (as in original post), and is not required in the
sequence-of-tuples mode if each tuple has a si
David Rueter added the comment:
Ah hah! Indeed, urlencode() does work on dictionaries as expected when
doseq=True. Thank you for clarifying.
FWIW I had read the documentation and the referenced examples multiple times. I
would like to make a few documentation suggestions for clarity.
1 ) Upda
R. David Murray added the comment:
That behavior is complex enough that I think it would be worth adding an
example of it to the examples section (and maybe linking directly from the
doseq explanation to that specific example).
--
assignee: -> docs@python
components: +Documentation
no
Gareth Rees added the comment:
If you read the documentation for urllib.parse.urlencode [1], you'll
see that it says:
The value element in itself can be a sequence and in that case, if
the optional parameter doseq is evaluates to True, individual
key=value pairs separated by '&' are
New submission from David Rueter:
In Python 3.4 I would like to serialize a dictionary into a URL-encoded string.
Given a dictionary like this:
>>> thisDict = {'SomeVar1': [b'abc'], 'SomeVar2': [b'def'], 'SomeVar3':
>>> [b'ghi']}
I would like to be able to return this string:
SomeVa