Message6992
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. |
|
Date |
User |
Action |
Args |
2012-03-31 05:31:17 | jeff250 | set | recipients:
+ jeff250 |
2012-03-31 05:31:17 | jeff250 | set | messageid: <1333171877.74.0.46123127041.issue1871@psf.upfronthosting.co.za> |
2012-03-31 05:31:17 | jeff250 | link | issue1871 messages |
2012-03-31 05:31:17 | jeff250 | create | |
|