Opened 12 years ago

Closed 11 years ago

#18481 closed Bug (fixed)

IOErrors from FILES are not wrapped with UnreadablePostError

Reported by: KyleMac Owned by: nobody
Component: HTTP handling Version: 1.4
Severity: Normal Keywords:
Cc: andre.cruz@…, hirokiky@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Ticket #17277 wrapped IOErrors when reading the POST body with the custom exception UnreadablePostError in order to make them easily identifiable and thus easily ignored. However the same is not done when reading FILES fails and a raw IOError is still raised.

Outside of AJAX it's failed file uploads that raise the most IOErrors and so UnreadablePostError is not currently very useful.

Attachments (3)

18481.patch (900 bytes ) - added by André Cruz 12 years ago.
Patch for bug
t18481_test.patch (1.1 KB ) - added by Hiroki Kiyohara 12 years ago.
Patch for testing
18481-2.patch (1.3 KB ) - added by André Cruz 12 years ago.
New patch that uses the standard raise format

Download all attachments as: .zip

Change History (14)

comment:1 by Aymeric Augustin, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by André Cruz, 12 years ago

Cc: andre.cruz@… added

by André Cruz, 12 years ago

Attachment: 18481.patch added

Patch for bug

comment:3 by André Cruz, 12 years ago

Has patch: set

by Hiroki Kiyohara, 12 years ago

Attachment: t18481_test.patch added

Patch for testing

comment:4 by Hiroki Kiyohara, 12 years ago

Cc: hirokiky@… added

I uploaded a patch about testing for this bug.

The testing was successful.
I applied the edevil's patch and run the testing with Python 2.7.1 and 3.3.

by André Cruz, 12 years ago

Attachment: 18481-2.patch added

New patch that uses the standard raise format

comment:5 by André Cruz, 12 years ago

I added a new patch that re-raises the exception in the standard format seen on the rest of the codebase.

comment:6 by Aymeric Augustin, 12 years ago

Type: UncategorizedBug

comment:7 by anonymous, 12 years ago

What's missing?

comment:8 by Ilkka Hakkari, 12 years ago

Needs tests: set

comment:9 by anonymous, 12 years ago

Threre is also a patch for tests already attached.

comment:10 by Tim Graham, 11 years ago

I believe this pull request is the same as the second patch, however, it doesn't have any tests (django/http/request.py is the only modified file).

https://github.com/django/django/pull/675

comment:11 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In de66b56790598f2ff97b8df859356d755ce64e20:

Fixed #18481 -- Wrapped request.FILES read error in UnreadablePostError

Thanks KyleMac for the report, André Cruz for the initial patch and
Hiroki Kiyohara for the tests.

Note: See TracTickets for help on using tickets.
Back to Top