#36974: SimpleUploadedFile should support text mode
-------------------------------------+-------------------------------------
Reporter: Denis Washington | Type:
| Uncategorized
Status: new | Component: File
| uploads/storage
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36974>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.