Ticket #18481: 18481.patch

File 18481.patch, 900 bytes (added by André Cruz, 12 years ago)

Patch for bug

  • django/http/request.py

    diff --git a/django/http/request.py b/django/http/request.py
    index d3f0888..7a8be1d 100644
    a b class HttpRequest(object):  
    238238
    239239    def read(self, *args, **kwargs):
    240240        self._read_started = True
    241         return self._stream.read(*args, **kwargs)
     241        try:
     242            return self._stream.read(*args, **kwargs)
     243        except IOError as e:
     244            six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])
    242245
    243246    def readline(self, *args, **kwargs):
    244247        self._read_started = True
    245         return self._stream.readline(*args, **kwargs)
     248        try:
     249            return self._stream.readline(*args, **kwargs)
     250        except IOError as e:
     251            six.reraise(UnreadablePostError, UnreadablePostError(*e.args), sys.exc_info()[2])
    246252
    247253    def xreadlines(self):
    248254        while True:
Back to Top