Message210531
If this was a function to encode a dict into something then I would see your point and agree. urlencode is specifically designed to work within the domain or URIs. In this domain, it is acceptable to have an empty value for a key in a query string. None is a representation of nothing, empty, null, the absence of a value. Therefore you would expect a function in the domain of URIs to construct a valid URI component when you specifically tell it to use None. Valid is up to you, either ignore the key-value pair completely, or use key[=&] to represent the empty value.
Take Requests as an example that gets it right:
>>> import requests
>>> requests.get('http://www.google.com/', params={'key': None}).url
u'http://www.google.com/'
>>> requests.get('http://www.google.com/', params={'key': ''}).url
u'http://www.google.com/?key=' |
|
Date |
User |
Action |
Args |
2014-02-07 19:21:06 | Joshua.Johnston | set | recipients:
+ Joshua.Johnston, orsenthil, ezio.melotti, r.david.murray, Claudiu.Popa |
2014-02-07 19:21:06 | Joshua.Johnston | set | messageid: <1391800866.67.0.940792746064.issue18857@psf.upfronthosting.co.za> |
2014-02-07 19:21:06 | Joshua.Johnston | link | issue18857 messages |
2014-02-07 19:21:06 | Joshua.Johnston | create | |
|