[issue8898] The email package should defer to the codecs module for all aliases

R. David Murray report at bugs.python.org
Fri May 27 16:24:06 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

Prompted on IRC, I see I missed the file because it was so short.

This still isn't what I'm looking for.  We are assuming that email is going to use the codec eventually so that it is not a bad thing to have charset pre-populate the codec cache.  So what I'm looking for is:

    try:
        python_name = codecs.lookup(input_charset).name
        mime_name = ALIASES.get(python_name, input_charset)
    except LookupError:
        mime_name = input_charset

MAL's idea was to implement the ALIASES step via a two-way mapping in the encodings module (python-canonical-name <=> MIME-preferred-name).  That would be fine, too, but the email.charset logic should look like the above however the table is implemented.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8898>
_______________________________________


More information about the Python-bugs-list mailing list