summaryrefslogtreecommitdiff
path: root/django/http/request.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-01-28 07:01:35 -0800
committerTim Graham <timograham@gmail.com>2019-01-28 11:15:06 -0500
commit7785e03ba89aafbd949191f126361fb9103cb980 (patch)
tree5776f7063604285445cfcebf6efb42fd5d063f60 /django/http/request.py
parent7444f3252757ed4384623e5afd7dcfeef3e0c74e (diff)
downloaddjango-7785e03ba89aafbd949191f126361fb9103cb980.tar.gz
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
Diffstat (limited to 'django/http/request.py')
-rw-r--r--django/http/request.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/http/request.py b/django/http/request.py
index f1c232d89a..51d0a8dfc3 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -22,7 +22,7 @@ RAISE_ERROR = object()
host_validation_re = re.compile(r"^([a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9\.:]+\])(:\d+)?$")
-class UnreadablePostError(IOError):
+class UnreadablePostError(OSError):
pass
@@ -284,7 +284,7 @@ class HttpRequest:
try:
self._body = self.read()
- except IOError as e:
+ except OSError as e:
raise UnreadablePostError(*e.args) from e
self._stream = BytesIO(self._body)
return self._body
@@ -339,14 +339,14 @@ class HttpRequest:
self._read_started = True
try:
return self._stream.read(*args, **kwargs)
- except IOError as e:
+ except OSError as e:
raise UnreadablePostError(*e.args) from e
def readline(self, *args, **kwargs):
self._read_started = True
try:
return self._stream.readline(*args, **kwargs)
- except IOError as e:
+ except OSError as e:
raise UnreadablePostError(*e.args) from e
def __iter__(self):