R. David Murray <rdmur...@bitdance.com> added the comment:

For various reasons the email module has a table of character sets.  What might 
be most effective would be for the email module to look a character set name up 
in the codecs module and find out the cannonical name of the character set, and 
then look that up in its table (ie: remove the aliases table from email 
completely, and instead depend on codecs to resolve the cannonical name).  
Unfortunately the codecs module does not recognize all of the aliases used by 
email, nor is there necessarily any guarantee that the two modules will agree 
on the proper cannonical name.

The attached patch instead uses the codecs module as a fallback if the charset 
name does not appear in the email package's ALIASES or CHARSETS tables.  It 
therefore makes both utf8 and utf_8 work, as well as all the other variants the 
codec module accepts.  The unit test just tests 'utf8', since if that one works 
all the others should too.

I'm tentatively reclassifying this as a bug rather than a feature request, 
since I think it is a reasonable expectation that email would support at least 
the same set of encoding names that the rest of Python does.

----------
nosy: +r.david.murray

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4487>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to