A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-January/011789.html below:

[Python-Dev] urllib.urlencode & repeated values

[Python-Dev] urllib.urlencode & repeated values [Python-Dev] urllib.urlencode & repeated valuesSkip 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

    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.

Skip



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