[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Guido van Rossum
Guido van Rossum added the comment: You have a point — I was just responding to Nick’s last message without noticing how old it was. I’ll remove myself from the nosy list. On Fri, Nov 22, 2019 at 15:14 Kristján Valur Jónsson wrote: > > Kristján Valur Jónsson added the comment: > > So you hav

[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: So you have already stated, and this issue is six years old now. While I no longer have a stake in this, I'd just like to reiterate that IMHO it breaks several good practices of architecture, particularly that of separation of roles. The abstraction

[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Guido van Rossum
Guido van Rossum added the comment: It is quite intentional that symlinks are followed for the purpose of computing sys. argv[0] and sys.path. -- --Guido (mobile) -- ___ Python tracker _

[issue17639] symlinking .py files creates unexpected sys.path

2019-11-22 Thread Socob
Change by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Nick Coghlan
Nick Coghlan added the comment: The reason I haven't documented sys.path[0] initialisation is because I know I don't fully understand it. Path initialisation in general has a lot of historical quirks, particularly once symlinks are involved. -- ___ Py

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Yes, of course. But I still maintain that the failure of python to work with a linktree of .py files, where the destination position of said links is arbitrary, is rather unusual, and IMHO violates the principle of least surprise. In this case, the e

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Guido van Rossum
Guido van Rossum added the comment: I'm sure there's some change that can be made to the scripts that solves this locally, without requiring any changes to Python. -- ___ Python tracker

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Nick Coghlan
Nick Coghlan added the comment: Not currently, because interpreter startup is a mess already. Overriding sys.path[0] initialisation is on the list for 3.4 already, I'm just advising strongly against piling any more complexity on top of the current rickety structure until we do something about

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: 1) _I_ am not using symlinks this way. The hadoop scheduling processor is. This means that we cannot use Python for it withouth hacking the scripts for the special case. Presumably applications are not generally breaking when run in an artificial fi

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Nick Coghlan
Nick Coghlan added the comment: I'll add it to the list of docs updates for post-PEP 432 (similar to the import system in general finally getting reference docs in 3.3 following the migration to importlib, I hope to have improved import state initialisation docs for 3.4 if I successfully tame

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Guido van Rossum
Guido van Rossum added the comment: Do not "fix" this. It is an intentional feature. There is a common pattern where one or more Python scripts are collected in some "bin" directory (presumably on the user's $PATH) as symlinks into the directory where they really live (not on $PATH, nor on sys

[issue17639] symlinking .py files creates unexpected sys.path

2013-04-05 Thread Charles-François Natali
Charles-François Natali added the comment: > How does the test suite react if you change the order of application to > resolve symlinks only after dropping the file name from the path? Note that this will break things, see e.g. http://bugs.python.org/issue1387483#msg186063 The only backward co

[issue17639] symlinking .py files creates unexpected sys.path[0]

2013-04-05 Thread Ralf Schmitt
Changes by Ralf Schmitt : -- nosy: +schmir ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue17639] symlinking .py files creates unexpected sys.path[0]

2013-04-05 Thread Nick Coghlan
Nick Coghlan added the comment: Adding Guido & Ned, as my recollection is that some of the weirdness in the sys.path[0] symlink resolution was to placate the test suite on Mac OS X (at least, that was a cause of failures in the initial runpy module implementation until Guido tracked down the d

[issue17639] symlinking .py files creates unexpected sys.path[0]

2013-04-05 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: btw, this is the opposite issue to issue #1387483 -- ___ Python tracker ___ ___ Python-bugs-

[issue17639] symlinking .py files creates unexpected sys.path[0]

2013-04-05 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson: When .py files are assembled into a directory structure using direct symbolic links to the files, something odd happens to sys.path[0]. Consider this file structure: /pystuff/ foo.py -> /scripts/foo.py bar.py -> /libs/bar.py foo.py contains the l