Message303784
| 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: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 | |