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 <>
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__'])"
$ ../py3k/python -c "import sys; sys.path.insert(0, 'linkdir'); import runpy; print(runpy.run_module('foo')['__file__'])"

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.
Date User Action Args
2012-07-18 11:12:06ncoghlansetrecipients: + ncoghlan, brett.cannon, georg.brandl
2012-07-18 11:12:06ncoghlansetmessageid: <>
2012-07-18 11:12:05ncoghlanlinkissue15385 messages
2012-07-18 11:12:04ncoghlancreate