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 ncoghlan
Recipients brett.cannon, georg.brandl, ncoghlan
Date 2012-07-18.11:12:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342609926.32.0.323615194944.issue15385@psf.upfronthosting.co.za>
In-reply-to
Content
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
2012-07-18 11:12:06ncoghlansetrecipients: + ncoghlan, brett.cannon, georg.brandl
2012-07-18 11:12:06ncoghlansetmessageid: <1342609926.32.0.323615194944.issue15385@psf.upfronthosting.co.za>
2012-07-18 11:12:05ncoghlanlinkissue15385 messages
2012-07-18 11:12:04ncoghlancreate