Message6992

Author jeff250
Recipients jeff250
Date 2012-03-31.05:31:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333171877.74.0.46123127041.issue1871@psf.upfronthosting.co.za>
In-reply-to
Content
This regression was introduced in changeset 6254:4c672dbbcdb2...
http://hg.python.org/jython/rev/4c672dbbcdb2?revcount=960

Suppose we have file structure:
somemodule/__init__.py
somemodule/somesubmodule.py

And somemodule/__init__.py contains import:
from . import somesubmodule

Then when we import somemodule, we have both 'somemodule.somesubmodule' *and* 'somesubmodule' (without a 'somemodule.' prefix) in sys.modules instead of just 'somemodule.somesubmodule'.  See the attached tarball for reproducing code.

One side effect of this bug is if the submodule has a name of another top level module name like 'time', then we can no longer import the real top level 'time' module after importing 'somemodule'.

The line where the bad entry is added is where we have:

modules.__setitem__(fullName, ret);

in the import_next method in org.python.core.imp.
History
Date User Action Args
2012-03-31 05:31:17jeff250setrecipients: + jeff250
2012-03-31 05:31:17jeff250setmessageid: <1333171877.74.0.46123127041.issue1871@psf.upfronthosting.co.za>
2012-03-31 05:31:17jeff250linkissue1871 messages
2012-03-31 05:31:17jeff250create