This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2003年10月30日 22:39 by myers_carpenter, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg18829 - (view) | Author: Myers Carpenter (myers_carpenter) | Date: 2003年10月30日 22:39 | |
>>>
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" = "['"
|
|||
| msg18830 - (view) | Author: Mike Brown (mike_j_brown) | Date: 2004年03月31日 06:01 | |
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.
|
|||
| msg18831 - (view) | Author: Myers Carpenter (myers_carpenter) | Date: 2004年03月31日 16:56 | |
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? |
|||
| msg18832 - (view) | Author: Mike Brown (mike_j_brown) | Date: 2004年04月01日 21:13 | |
Logged In: YES user_id=371366 I am only guessing, here, but if you had an object that you wanted to embed a representation of in a URL or in HTML form data, it would be prudent to call str() on the object and let its __str__ method give you a string representation, and then you'd percent-encode that. This makes sense for user- defined classes, where you can define __str__, but not for built-in types like an ordinary list, so they give you the doseq flag for those situations. |
|||
| msg18833 - (view) | Author: Myers Carpenter (myers_carpenter) | Date: 2004年04月04日 01:19 | |
Logged In: YES user_id=335935 Ok... closing |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:00 | admin | set | github: 39479 |
| 2003年10月30日 22:39:03 | myers_carpenter | create | |