[ python-Bugs-833405 ] urllib.urlencode doesn't work for output
from cgi.parse_qs
SourceForge.net
noreply at sourceforge.net
Wed Mar 31 11:56:25 EST 2004
Bugs item #833405, was opened at 2003-10-30 17:39
Message generated for change (Comment added) made by myers_carpenter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Myers Carpenter (myers_carpenter)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib.urlencode doesn't work for output from cgi.parse_qs
Initial Comment:
>>>
urllib.urlencode(cgi.parse_qsl('ext=.jpg&outquality=56'))
'ext=.jpg&outquality=56'
>>>
urllib.urlencode(cgi.parse_qs('ext=.jpg&outquality=56'))
'ext=%5B%27.jpg%27%5D&outquality=%5B%2756%27%5D'
"%5B%27" = "['"
----------------------------------------------------------------------
>Comment By: Myers Carpenter (myers_carpenter)
Date: 2004-03-31 11:56
Message:
Logged In: YES
user_id=335935
Can you name one web app that you know will take args in the
form of "ext=[27.jpg]"? Why not do some type inspection to
see what types you are dealing with? What is the use of
encoding a list in a url using python syntax?
----------------------------------------------------------------------
Comment By: Mike Brown (mike_j_brown)
Date: 2004-03-31 01:01
Message:
Logged In: YES
user_id=371366
As per the urlencode() API documentation, you are passing in
sequences, so you need to set the doseq flag.
>>> urllib.urlencode(cgi.parse_qs
('ext=.jpg&outquality=56'),doseq=1)
'ext=.jpg&outquality=56'
I recommend that this bug report be closed as Invalid.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=833405&group_id=5470
More information about the Python-bugs-list
mailing list