[Python-Dev] urllib.urlencode & repeated values

Skip Montanaro skip@mojam.com (Skip Montanaro)
Wed, 17 Jan 2001 22:20:30 -0600 (CST)

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


I get a quoted stringified tuple:


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

If others agree I'd be happy to whip up a patch.  I think it's a bug.