diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-03 12:54:06 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-03 13:03:15 +0100 |
| commit | 095eca8dd85cb27ed0b22829903df10f19cdab6c (patch) | |
| tree | dba97f49c93310fc86c0d494bd9b93f5b25317f0 /django | |
| parent | ac2052ebc84c45709ab5f0f25e685bf656ce79bc (diff) | |
Fixed #19101 -- Decoding of non-ASCII POST data on Python 3.
Thanks Claude Paroz.
Diffstat (limited to 'django')
| -rw-r--r-- | django/http/multipartparser.py | 2 | ||||
| -rw-r--r-- | django/http/request.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index 40aefd6e9d..5bcc874982 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -110,7 +110,7 @@ class MultiPartParser(object): # HTTP spec says that Content-Length >= 0 is valid # handling content-length == 0 before continuing if self._content_length == 0: - return QueryDict(MultiValueDict(), encoding=self._encoding), MultiValueDict() + return QueryDict('', encoding=self._encoding), MultiValueDict() # See if the handler will want to take care of the parsing. # This allows overriding everything if somebody wants it. diff --git a/django/http/request.py b/django/http/request.py index 96c7606c86..d3f0888d47 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -276,6 +276,9 @@ class QueryDict(MultiValueDict): encoding = settings.DEFAULT_CHARSET self.encoding = encoding if six.PY3: + if isinstance(query_string, bytes): + # query_string contains URL-encoded data, a subset of ASCII. + query_string = query_string.decode() for key, value in parse_qsl(query_string or '', keep_blank_values=True, encoding=encoding): |
