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.
Created on 2012年07月18日 11:12 by ncoghlan, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (1) | |||
|---|---|---|---|
| msg165754 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年07月18日 11:12 | |
Directory setup: linkdir is a symlink to realdir
$ python3 -c "import sys; sys.path.insert(0, 'linkdir'); import runpy; print(runpy.run_module('foo')['__file__'])"
/home/ncoghlan/devel/play/realdir/foo.py
$ ../py3k/python -c "import sys; sys.path.insert(0, 'linkdir'); import runpy; print(runpy.run_module('foo')['__file__'])"
/home/ncoghlan/devel/play/linkdir/foo.py
The culprit is pkgutil - the import emulation includes a realpath() call. Looking at the log, this dates from PJE's consolidation of the various import emulations back in 2006, with no specific rationale given.
Since this was only in the emulation, and nothing else broke when we took it out (indeed, it was the cause of test failures in 3.2, when it altered the __file__ values in ways the test wasn't expecting), I'm just creating and closing this issue to note that yes, I'm aware this has changed, but no, I don't consider it a problem, as it just brings pkgutil into line with the behaviour of normal imports.
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:33 | admin | set | github: 59590 |
| 2012年07月18日 11:12:59 | ncoghlan | set | status: open -> closed resolution: works for me |
| 2012年07月18日 11:12:05 | ncoghlan | create | |