Message303784
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' |
|
Date |
User |
Action |
Args |
2017-10-05 20:12:52 | francois.freitag | set | recipients:
+ francois.freitag |
2017-10-05 20:12:52 | francois.freitag | set | messageid: <1507234372.12.0.213398074469.issue31706@psf.upfronthosting.co.za> |
2017-10-05 20:12:52 | francois.freitag | link | issue31706 messages |
2017-10-05 20:12:52 | francois.freitag | create | |
|