Nick Coghlan <[EMAIL PROTECTED]> added the comment:
Using relative imports within smtplib wouldn't have made any difference
in this case. Your dummy email package was the first one encountered on
sys.path, so the "import email.smtplib" line (which does an "import
email" internally as the first st
Bruce Frederiksen <[EMAIL PROTECTED]> added the comment:
OK, I see where I mis-diagnosed the problem. It seems that importing
smtplib (for example) shouldn't get confused with my email package. As
I understand it, using relative imports within a package should avoid
the problem of the names of
Nick Coghlan <[EMAIL PROTECTED]> added the comment:
Running the interactive interpreter like that places the current
directory on sys.path, so it *is* doing an absolute import of your
pseudo email package. (If it didn't do that, your test would fail at the
"import foo" line)
Instead of cd'ing in
New submission from Bruce Frederiksen <[EMAIL PROTECTED]>:
Try this to reproduce error:
$ mkdir -p test/email
$ cd test
$ touch __init__.py email/__init__.py
$ cat < foo.py
from __future__ import absolute_import
import smtplib
!
$ python
>>> import foo
...
File "/usr/lib/python2.6/smtplib.py",