Bug getting i18n'ed attachment filenames (RFC2231)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Mailman |
Fix Released
|
High
|
Barry Warsaw |
Bug Description
RFC 2231 allows filenames to have non-ascii characters. The get_filename() method in Python's Message class handles this by calling email.utils.
This fails in Mailman because the mailman.
File "/usr/lib/
return unicode(rawval, charset, errors)
TypeError: decoding Unicode is not supported
A possible solution to this would be to make Mailman's Message get_filename() method be more than just an exception-catching wrapper, and re-implement the original get_filename() method, inserting a conversion to str before calling collapse_
Does this make sense ? Any other idea for a possible solution ?
Related branches
- Barry Warsaw: Approve
-
Diff: 268 lines (+68/-42)13 files modifiedsrc/mailman/app/bounces.py (+4/-1)
src/mailman/app/moderator.py (+3/-3)
src/mailman/archiving/mailarchive.py (+2/-0)
src/mailman/archiving/mhonarc.py (+2/-0)
src/mailman/archiving/prototype.py (+2/-0)
src/mailman/commands/docs/unshunt.rst (+1/-1)
src/mailman/commands/eml_membership.py (+2/-0)
src/mailman/email/message.py (+9/-35)
src/mailman/email/tests/test_message.py (+33/-1)
src/mailman/model/bounce.py (+4/-1)
src/mailman/model/messagestore.py (+2/-0)
src/mailman/rules/implicit_dest.py (+2/-0)
src/mailman/utilities/email.py (+2/-0)
tags: | added: mailman3 |
no longer affects: | mailman/2.1 |
no longer affects: | mailman/3.0 |
Changed in mailman: | |
milestone: | none → 3.0.0b5 |
assignee: | nobody → Barry Warsaw (barry) |
importance: | Undecided → High |
status: | New → Fix Committed |
Changed in mailman: | |
status: | Fix Committed → Fix Released |
See the TestMessageSubclass testcase I've added to the attached testsuite for a way to reproduce it.
It's actually a little harder that I first thought, encoding the filename in the middle of the method is not enough.