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 jbeulich
Recipients jbeulich
Date 2009-06-30.10:05:42
SpamBayes Score 3.4038756e-09
Marked as misclassified No
Message-id <1246356344.6.0.218965497612.issue6386@psf.upfronthosting.co.za>
In-reply-to
Content
Due to the way PySys_SetArgv() works, when the initial script is a
symbolic link, importing from normal files in the same directory does
not work. This is particularly surprising when the work tree is a
symlinked clone (cp -s) of an original (i.e. snapshot) tree with a few
modifications (patches) applied to one or more of the modules imported
from: Due the the erratum, the modifications made will appear to not
take effect until one realizes that the wrong module is being imported from.

The solution would in my opinion be to not only add the path left after
the readlink()/realpath() processing to the import search path list, but
also any intermediately encountered ones (in the order processed) as
long as the leaf component continues to be a symlink.

(Note: It seems pointless to use readlink() in the current [3.1 and
earlier] implementation, since the result gets passed to realpath()
anyway. Also, the documentation doesn't seem to mention this behavior,
and from the sources it remains unclear why this processing is needed at
all.)
History
Date User Action Args
2009-06-30 10:05:44jbeulichsetrecipients: + jbeulich
2009-06-30 10:05:44jbeulichsetmessageid: <1246356344.6.0.218965497612.issue6386@psf.upfronthosting.co.za>
2009-06-30 10:05:43jbeulichlinkissue6386 messages
2009-06-30 10:05:42jbeulichcreate