summaryrefslogtreecommitdiff
path: root/django/http/request.py
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2013-09-30 17:55:14 +0200
committerBaptiste Mispelon <bmispelon@gmail.com>2013-10-05 11:50:03 +0200
commit20472aa827669d2b83b74e521504e88e18d086a1 (patch)
treeb5d6f49c10e746ecae227b33352ac29ec85fed79 /django/http/request.py
parent948d209adac566d89f44f073fdd77a371c18e269 (diff)
downloaddjango-20472aa827669d2b83b74e521504e88e18d086a1.tar.gz
Fixed #21189: Cleaned up usage of bare except clauses.
Thanks to berkerpeksag for the report and to claudep for the review.
Diffstat (limited to 'django/http/request.py')
-rw-r--r--django/http/request.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/http/request.py b/django/http/request.py
index 9f9f32b1b4..f19ccaf068 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -16,7 +16,7 @@ from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.files import uploadhandler
-from django.http.multipartparser import MultiPartParser
+from django.http.multipartparser import MultiPartParser, MultiPartParserError
from django.utils import six
from django.utils.datastructures import MultiValueDict, ImmutableList
from django.utils.encoding import force_bytes, force_text, force_str, iri_to_uri
@@ -222,7 +222,7 @@ class HttpRequest(object):
data = self
try:
self._post, self._files = self.parse_file_upload(self.META, data)
- except:
+ except MultiPartParserError:
# An error occured while parsing POST data. Since when
# formatting the error the request handler might access
# self.POST, set self._post and self._file to prevent
@@ -230,7 +230,7 @@ class HttpRequest(object):
# Mark that an error occured. This allows self.__repr__ to
# be explicit about it instead of simply representing an
# empty POST
- self._mark_post_parse_error()
+ # self._mark_post_parse_error()
raise
elif self.META.get('CONTENT_TYPE', '').startswith('application/x-www-form-urlencoded'):
self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()