This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author peter.otten
Recipients brett.cannon, eric.snow, mythsmith, ncoghlan, peter.otten
Date 2014-05-22.17:17:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400779046.99.0.0722556715482.issue21553@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a simpler demo for what I believe you are experiencing:

$ mkdir package
$ cd package/
$ touch __ini__.py module.py
$ export PYTHONPATH=..
$ python3
Python 3.3.2+ (default, Feb 28 2014, 00:52:16) 
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import module, package.module
>>> module is package.module
False

Even though module and package.module correspond to the same file
Python does not recognize that you intend the former to be part of a package. Your run0.py script goes through its sys.path entries and unfortunately the first entry points into a package so that all modules in that package become also visible as toplevel modules.

A good way to avoid this trap is to use relative imports

>>> from . import module
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: Parent module '' not loaded, cannot perform relative import
History
Date User Action Args
2014-05-22 17:17:27peter.ottensetrecipients: + peter.otten, brett.cannon, ncoghlan, eric.snow, mythsmith
2014-05-22 17:17:26peter.ottensetmessageid: <1400779046.99.0.0722556715482.issue21553@psf.upfronthosting.co.za>
2014-05-22 17:17:26peter.ottenlinkissue21553 messages
2014-05-22 17:17:26peter.ottencreate