import module name collision

C

Chris Foote

Today I happened to accidentally name one of my project's
files 'email.py', which collides with the module of the
same name in Python's standard library:

from email.MIMEText import MIMEText

which causes problems within MIMEText later:

File "/usr/lib/python2.3/smtplib.py", line 49, in ?
from email.base64MIME import encode as encode_base64
ImportError: No module named base64MIME

Is there any mechanism to refer to standard library
modules so that there's no name collision problem with
the local filename ?

.... or any other solution ?

Cheers,
Chris
 
P

Peter Maas

Chris said:
Today I happened to accidentally name one of my project's
files 'email.py', which collides with the module of the
same name in Python's standard library:

> from email.MIMEText import MIMEText

from email.MIMEText import MIMEText as YetAnotherMIMEText
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top