Opened 4 weeks ago

Closed 2 weeks ago

#36974 closed New feature (needsnewfeatureprocess)

SimpleUploadedFile should support text mode

Reported by: Denis Washington Owned by: Dinesh Thumma
Component: File uploads/storage Version: 6.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, SimpleUploadedFile requires a bytes-like object to be passed as content, and open() always returns a BytesIO. This makes it useless in contexts where text-mode file-like object is expected. (I hit this issue when trying to pass file.open() to pandas.read_csv(), for instance.)

It would be great if SimpleUploadedFile would alternatively accept a str, in which case open() would then return a StringIO instead.

Change History (4)

comment:1 by Dinesh Thumma, 4 weeks ago

Owner: set to Dinesh Thumma
Status: newassigned

comment:2 by Elias Stinson, 4 weeks ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

I'm not 100% sure what involvement would be required to move this forward, but I do think it's a valid and valuable addition to the overall codebase and support. I'll mark the triage status as approved because this seems like a clear addition.

comment:3 by Jacob Walls, 4 weeks ago

Triage Stage: AcceptedUnreviewed
Type: New featureUncategorized

Elias, the next steps box earlier on this page advises to give a second opinion when accepting if the subject is debatable in any form. The second opinion you've given is vague: "valid, valuable, clear addition". That's not helpful.

You should stop contributing low-quality triage.

comment:4 by Jacob Walls, 2 weeks ago

Resolution: needsnewfeatureprocess
Status: assignedclosed
Type: UncategorizedNew feature

Thanks for the idea. When suggesting a new feature for Django, the feature idea should first be proposed and discussed with the community. To do that, please raise this on the new feature tracker.

I'll close the ticket for now, but if the community agrees with the proposal, please return to this ticket and reference the forum discussion so we can re-open it. For more information, please refer to the documented guidelines for requesting features.

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