Skip to content

Commit

Permalink
Fix keys in wsgi request arguments being bytes in python3 when conten…
Browse files Browse the repository at this point in the history
…t-type is application/x-www-form-urlencoded.
  • Loading branch information
jsamuel committed Mar 19, 2012
1 parent bcbef8c commit 1c6dc7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tornado/wsgi.py
Expand Up @@ -43,7 +43,7 @@
from tornado import escape
from tornado import httputil
from tornado import web
from tornado.escape import native_str, utf8
from tornado.escape import native_str, utf8, parse_qs_bytes
from tornado.util import b

try:
Expand Down Expand Up @@ -146,7 +146,7 @@ def __init__(self, environ):
self.files = {}
content_type = self.headers.get("Content-Type", "")
if content_type.startswith("application/x-www-form-urlencoded"):
for name, values in cgi.parse_qs(self.body).iteritems():
for name, values in parse_qs_bytes(native_str(self.body)).iteritems():
self.arguments.setdefault(name, []).extend(values)
elif content_type.startswith("multipart/form-data"):
if 'boundary=' in content_type:
Expand Down

0 comments on commit 1c6dc7c

Please sign in to comment.