[issue29578] "python.exe t2.py" doesn't work the same on Python-3.6 as Python-3.5

Paul Moore report at bugs.python.org
Thu Feb 16 04:46:50 EST 2017


Paul Moore added the comment:

No (see the doc link I referenced) - paths are absolute, or relative to the _pth file. So "." means "in the same place as the pth file".

I don't think there's a way with _pth files to get the "add the location of the executed script to the front of sys.path" behaviour. It's not really a good idea for an embedded interpreter (which is the _pth file intended use case) as it makes it a bit too easy to run code from unexpected locations.

In an embedded application, you could of course add sys.path entries in your C code. Maybe WinPython could do that too?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29578>
_______________________________________


More information about the Python-bugs-list mailing list