This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author francois.freitag
Recipients francois.freitag
Date 2017-10-05.20:12:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507234372.12.0.213398074469.issue31706@psf.upfronthosting.co.za>
In-reply-to
Content
The urlencode documentation states that:
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 generated for each element of the value sequence for the key.

Passing a generator as the value gives unexpected results:
>>> from urllib.parse import urlencode
>>> def gen():
...     yield from range(2)
>>> urlencode({'a': gen()}, doseq=True)
'a=%3Cgenerator+object+gen+at+0x7f35ff78db48%3E'

A list gives:
>>> urlencode({'a': [0, 1]}, doseq=True)
'a=0&a=1'
History
Date User Action Args
2017-10-05 20:12:52francois.freitagsetrecipients: + francois.freitag
2017-10-05 20:12:52francois.freitagsetmessageid: <1507234372.12.0.213398074469.issue31706@psf.upfronthosting.co.za>
2017-10-05 20:12:52francois.freitaglinkissue31706 messages
2017-10-05 20:12:52francois.freitagcreate