> I'm pretty sure this has come up before, but urllib.urlencode doesn't handle > repeated parameters properly. If I call > > urllib.urlencode({"performers": ("U2","Lawrence Martin")}) > > instead of getting > > performers=U2&performers=Lawrence+Martin > > I get a quoted stringified tuple: > > performers=%28%27U2%27%2c+%27Lawrence+Martin%27%29 > > Obviously, fixing this will change the function's current semantics, but I > think it's worth treating lists and tuples (actually, any sequence) as > repeated values. If the existing semantics are deemed valuable enough, a > third default parameter could be added to switch on the new behavior when > desired. > > If others agree I'd be happy to whip up a patch. I think it's a bug. Agreed. If you can come up with something that supports all sequence types, and treats singleton sequences the same as their one and only item, it would even be the inverse of cgi.parse_qs()! --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4