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 2009年06月07日 22:07 by efosmark, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg89060 - (view) | Author: Evan Fosmark (efosmark) | Date: 2009年06月07日 22:07 | |
Right now, it seems impossible to use cgi.FieldStorage in 3.0 if you're giving it environ['wsgi.input'] like so: post_data = cgi.FieldStorage( fp=environ["wsgi.input"], environ=environ, keep_blank_values=True ) It gives the following error: File "/usr/local/lib/python3.0/cgi.py", line 489, in __init__ self.read_urlencoded() File "/usr/local/lib/python3.0/cgi.py", line 589, in read_urlencoded self.strict_parsing): File "/usr/local/lib/python3.0/urllib/parse.py", line 377, in parse_qsl pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] TypeError: Type str doesn't support the buffer API |
|||
| msg92621 - (view) | Author: Michal Hordecki (MHordecki) | Date: 2009年09月14日 16:49 | |
It is because FieldStorage requires str, whereas wsgi.input gives bytes. You can always wrap environ['wsgi.input'] in TextIOWrapper. |
|||
| msg139646 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月02日 13:41 | |
Closing as duplicate. The other report has more discussion. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:49 | admin | set | github: 50483 |
| 2011年07月02日 13:41:13 | eric.araujo | set | status: open -> closed superseder: WSGI, cgi.FieldStorage incompatibility nosy: + eric.araujo messages: + msg139646 resolution: duplicate stage: resolved |
| 2010年08月27日 14:56:26 | BreamoreBoy | set | versions: + Python 3.1, Python 2.7, Python 3.2, - Python 3.0 |
| 2010年08月27日 03:19:27 | flox | set | nosy:
+ flox |
| 2009年09月14日 16:49:23 | MHordecki | set | nosy:
+ MHordecki messages: + msg92621 |
| 2009年06月15日 21:32:23 | milesck | set | nosy:
+ milesck |
| 2009年06月07日 22:07:35 | efosmark | create | |