#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019cc34d4a2c-e33dfa2d-a95a-4a91-982e-21240e61b298-000000%40eu-central-1.amazonses.com.