Code

Opened 2 years ago

Closed 14 months 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 edevil 20 months ago.
Patch for bug
t18481_test.patch (1.1 KB) - added by hirokiky 18 months ago.
Patch for testing
18481-2.patch (1.3 KB) - added by edevil 18 months ago.
New patch that uses the standard raise format

Download all attachments as: .zip

Change History (14)

comment:1 Changed 2 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 20 months ago by edevil

  • Cc andre.cruz@… added

Changed 20 months ago by edevil

Patch for bug

comment:3 Changed 20 months ago by edevil

  • Has patch set

Changed 18 months ago by hirokiky

Patch for testing

comment:4 Changed 18 months ago by hirokiky

  • 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.

Changed 18 months ago by edevil

New patch that uses the standard raise format

comment:5 Changed 18 months ago by edevil

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

comment:6 Changed 16 months ago by aaugustin

  • Type changed from Uncategorized to Bug

comment:7 Changed 14 months ago by anonymous

What's missing?

comment:8 Changed 14 months ago by derega

  • Needs tests set

comment:9 Changed 14 months ago by anonymous

Threre is also a patch for tests already attached.

comment:10 Changed 14 months ago by timo

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 Changed 14 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.