]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix keys in wsgi request arguments being bytes in python3 when content-type is applic... 481/head
authorJustin Samuel <js@justinsamuel.com>
Mon, 19 Mar 2012 22:09:23 +0000 (15:09 -0700)
committerJustin Samuel <js@justinsamuel.com>
Mon, 19 Mar 2012 22:09:23 +0000 (15:09 -0700)
tornado/wsgi.py

index 7e793e9c2779f848db822e8e96a939e4cc091e80..b756f7022eac4e93439ce3d01d6f4cda9716d427 100644 (file)
@@ -43,7 +43,7 @@ import urllib
 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:
@@ -146,7 +146,7 @@ class HTTPRequest(object):
         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: