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 neologix
Recipients jackjansen, kowaltowski, kristjan.jonsson, neologix
Date 2013-04-05.07:06:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM0JrF-Ea9df2rxpWBEAwageD+FGKwKbLZb9EwXkTX1PGQ@mail.gmail.com>
In-reply-to <1365093212.55.0.0497999086796.issue1387483@psf.upfronthosting.co.za>
Content
> I am not sure about what use cases could be broken by the above change, do you have examples?
> Normal use cases of symbolic links have to do with linking entire folders, not individual files, and that behaviour would not be broken by  such a hypothetical change, I think.

For example:

/tmp/
    foo/
        foo.py
        libfoo.py

    foo.py -> /tmp/foo/foo.py

With foo.py containing "import libfoo".

Now, calling /tmp/foo.py works because sys.path[0] ==
dirname(realpath("/tmp/foo.py")) == dirname("/tmp/foo/foo.py") ==
"/tmp/foo.

If we change sys.path[0] to not dereference the symlink (that's how I
understood your suggestion, maybe I got it wrong), it will now be
/tmp, and importing libfoo will fail.

That's AFAICT exacyly the problem reported by the OP on OS-X.
History
Date User Action Args
2013-04-05 07:06:09neologixsetrecipients: + neologix, jackjansen, kowaltowski, kristjan.jonsson
2013-04-05 07:06:09neologixlinkissue1387483 messages
2013-04-05 07:06:09neologixcreate