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

Michele Orrù report at bugs.python.org
Sun May 22 08:48:08 CEST 2011


Michele Orrù <maker.py at gmail.com> added the comment:

Well, actually encodings.aliases links to the encoding _module name_, as
described in the doc:
""" Encoding Aliases Support
    This module is used by the encodings package search function to
    map encodings names to module names.
"""
So I've adjusted your snippet according to this, as you can see in the
attachment.

I've also slightly changed the imports as pep8 says:
"""
Yes: import os
import sys

No: import sys, os
"""

Anyway, running the test failed for two encodings, there are two bugs there,
indeed.
- mcbs has something broken in its imports;
- tactis module is not present.

Since they are really easy to fix, I haven't yet reported to the bugtraker.
Let me know what should I do.
Post on bugs.python.org bug and patch? Any new test specifically for the
email module?

----------
Added file: http://bugs.python.org/file22057/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8898>
_______________________________________
-------------- next part --------------
<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> Regarding the tests, I don&#39;t see tests for the aliases anywhere, so something like:<br>



for alias, codec_name in encodings.aliases.items():<br>
    self.assertEqual(codecs.lookup(alias).name, codec_name)<br>
could be added somewhere to check that all the aliases in the dict map to the correct codec.<br></blockquote>Well, actually encodings.aliases links to the encoding _module name_, as described in the doc:<br>&quot;&quot;&quot; Encoding Aliases Support<br>

    This module is used by the encodings package search function to<br>    map encodings names to module names.<br>&quot;&quot;&quot;<br>So I&#39;ve adjusted your snippet according to this, as you can see in the attachment.</div>

<div class="gmail_quote"><br>I&#39;ve also slightly changed the imports as pep8 says:<br>&quot;&quot;&quot;<br>        Yes: import os<br>             import sys<br><br>        No:  import sys, os<div>&quot;&quot;&quot;</div>

<div><br></div><div>Anyway, running the test failed for two encodings, there are two bugs there, indeed.</div><div>- mcbs has something broken in its imports;</div><div>- tactis module is not present.</div><div><br></div>

<div>Since they are really easy to fix, I haven&#39;t yet reported to the bugtraker. Let me know what should I do.</div><div>Post on <a href="http://bugs.python.org">bugs.python.org</a> bug and patch? Any new test specifically for the email module?</div>

<div><br></div></div>-- <br>Michele Orrù<br>


More information about the Python-bugs-list mailing list