urlencode() doseq and Python 3.0

Thomas Guettler hv at tbz-pariv.de
Thu Oct 30 03:56:58 EDT 2008


Hi,

I think the default of urlencode doseq being false is just
there to preserve the old behavior.


http://svn.python.org/view/python/branches/py3k/Lib/urllib/parse.py?rev=66199&sortby=date&view=markup

{{{
   ...
   if not doseq:
        # preserve old behavior
}}}

I guess no one want really wants this:

>>> urllib.urlencode({'key': ['value1', 'value2']})
'key=%5B%27value1%27%2C+%27value2%27%5D'

I think this is what most people want:
>>> urllib.urlencode({'key': ['value1', 'value2']}, doseq=True)
'key=value1&key=value2'


Should I open a bug against 3.0?

  Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de



More information about the Python-list mailing list