[issue2622] Import errors in email.message.py

Mads Kiilerich report at bugs.python.org
Fri Apr 25 15:58:00 CEST 2008


Mads Kiilerich <mads at kiilerich.com> added the comment:

AFA I understand it the ImportError comes when running a py2exe/app'ed
package where iterators.py hasn't been included.

I was just about to file a report about (I think) the same issue, seen
on XP when py2exe'ing code using the email module.

Exactly the same problem with a good(?) explanation can be found on
http://mail.python.org/pipermail/spambayes/2007-December/021485.html

The problem comes because the real module names now are lowercase, and
email/__init__.py plays tricks with _LOWERNAMES in order to keep the old
uppercase names working. The problem is that the email lib itself uses
the old (deprecated?) non-existing name.

IMHO the solution is to use right-cased names. I have (only) tested it
by changing the single reference to email.Iterators. I think this is a
safe bugfix which should be included in 2.5 ASAP.

A workaround is to import email.iterators from some other code or to
tell py2exe/pyapp explicitly include the modules in the package.

----------
nosy: +kiilerix

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2622>
__________________________________


More information about the Python-bugs-list mailing list