#27007: Handle non-UTF-8 bytes objects for text/* attachments
-------------------------------------+-------------------------------------
Reporter: Feuermurmel | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Mail) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Feuermurmel):
Replying to [comment:3 timgraham]:
Sorry for not mentioning #26802. That change did improve the situation,
allowing `bytes` objects. But it tries to unconditionally decode it as
UTF-8 (compared to the logic in `attach_file()`, which falls back to
treating it as a binary file). This means that if a `bytes` object is
passed which does not contain valid UTF-8, a `UnicodeDecodeError` will be
thrown.
With the changes in the pull request, the behavior is the same as when
attaching a non-UTF-8 file.
--
Ticket URL: <https://code.djangoproject.com/ticket/27007#comment:5>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.bccbd0e9bfb127a1418873f9cf4d5800%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.