[issue24460] urlencode() of dictionary not as expected

2015-06-19 Thread Martin Panter
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

[issue24460] urlencode() of dictionary not as expected

2015-06-17 Thread David Rueter
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

[issue24460] urlencode() of dictionary not as expected

2015-06-17 Thread R. David Murray
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

[issue24460] urlencode() of dictionary not as expected

2015-06-17 Thread Gareth Rees
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

[issue24460] urlencode() of dictionary not as expected

2015-06-16 Thread David Rueter
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