Refs #22897 -- Removed unneeded empty string QueryDict argument.

This commit is contained in:
Tim Graham 2016-05-03 12:04:08 -04:00
parent ac77c55bc5
commit ead21a1949
2 changed files with 6 additions and 6 deletions

View File

@ -120,7 +120,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('', encoding=self._encoding), MultiValueDict()
return QueryDict(encoding=self._encoding), MultiValueDict()
# See if any of the handlers take care of the parsing.
# This allows overriding everything if need be.
@ -135,7 +135,7 @@ class MultiPartParser(object):
return result[0], result[1]
# Create the data structures to be used later.
self._post = QueryDict('', mutable=True)
self._post = QueryDict(mutable=True)
self._files = MultiValueDict()
# Instantiate the parser and stream:

View File

@ -267,14 +267,14 @@ class HttpRequest(object):
return self._body
def _mark_post_parse_error(self):
self._post = QueryDict('')
self._post = QueryDict()
self._files = MultiValueDict()
self._post_parse_error = True
def _load_post_and_files(self):
"""Populate self._post and self._files if the content-type is a form type"""
if self.method != 'POST':
self._post, self._files = QueryDict('', encoding=self._encoding), MultiValueDict()
self._post, self._files = QueryDict(encoding=self._encoding), MultiValueDict()
return
if self._read_started and not hasattr(self, '_body'):
self._mark_post_parse_error()
@ -301,7 +301,7 @@ class HttpRequest(object):
elif self.content_type == 'application/x-www-form-urlencoded':
self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()
else:
self._post, self._files = QueryDict('', encoding=self._encoding), MultiValueDict()
self._post, self._files = QueryDict(encoding=self._encoding), MultiValueDict()
def close(self):
if hasattr(self, '_files'):
@ -473,7 +473,7 @@ class QueryDict(MultiValueDict):
:arg safe: Used to specify characters which do not require quoting, for
example::
>>> q = QueryDict('', mutable=True)
>>> q = QueryDict(mutable=True)
>>> q['next'] = '/a&b/'
>>> q.urlencode()
'next=%2Fa%26b%2F'