#11144 closed (fixed)
UnicodeEncodeError when unicode characters present in To/From/Cc and also a comma is present
| Reported by: | anonymous | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Mail) | Version: | 1.0 |
| Severity: | Keywords: | UnicodeEncodeError | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This address will work fine: "Joe Blöggs" <joe.bloggs@…>
However, this address will fail: "Blöggs, Joe" <joe.bloggs@…>
The reason is because Django is doing a simple val.split(",") instead of proper parsing of the addresses.
Bug location: django/core/mail.py:forbid_multi_line_headers line 82 (In 1.0.2 at least)
It's also present in the dev version!
Attachments (2)
Change History (8)
comment:1 by , 17 years ago
| milestone: | 1.1 |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
by , 17 years ago
| Attachment: | bug11144.patch added |
|---|
Use email.Utils.getaddresses instead of toaddrstring.split(",")
comment:2 by , 17 years ago
| Has patch: | set |
|---|
Patch attached. Although handling header encoding in a function named forbid_multi_line_headers doesn't seem optimal.
by , 17 years ago
| Attachment: | bug11144.2.patch added |
|---|
Use email.Utils.getaddresses instead of toaddrstring.split(",") + regression test
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
So far as I know, Django doesn't attempt to support every address/name format permitted by the RFC. But regardless of the decision on this one, it's not a milestone 1.1 bug -- only critical blockers are being accepted for that now.