Issue1871
Created on 2012-03-31.05:31:17 by jeff250, last changed 2012-05-15.02:07:00 by fwierzbicki.
msg6992 (view) |
Author: Jeffrey Knockel (jeff250) |
Date: 2012-03-31.05:31:17 |
|
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.
|
msg6993 (view) |
Author: Jeffrey Knockel (jeff250) |
Date: 2012-03-31.05:38:54 |
|
Also attaching an example where after the time submodule is imported we can no longer import the real top-level time module.
|
msg7047 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-04-11.17:37:20 |
|
Sorry for the slow response Jeffrey, I have reproduced the bug and will make sure it is fixed for 2.5.3b2
|
msg7091 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-05-15.02:06:40 |
|
Fixed in 2.5 branch and default (2.7) branch.
|
|
Date |
User |
Action |
Args |
2012-05-15 02:07:00 | fwierzbicki | set | type: behaviour |
2012-05-15 02:06:41 | fwierzbicki | set | status: open -> closed resolution: accepted -> fixed messages:
+ msg7091 |
2012-04-11 17:37:20 | fwierzbicki | set | priority: high assignee: fwierzbicki resolution: accepted messages:
+ msg7047 |
2012-03-31 18:14:29 | fwierzbicki | set | nosy:
+ fwierzbicki |
2012-03-31 05:38:54 | jeff250 | set | files:
+ jython-bug-time.tar.gz messages:
+ msg6993 |
2012-03-31 05:31:17 | jeff250 | create | |
|