Re:Pip -t: A simple and transparent alternative to virtualen...
by ehremo on Thursday June 25, 2015 @01:14PM
(#9779393)
Actually I don't believe that would happen. I think the relative PYTHONPATH gets expanded at startup and becomes an absolute path. Subsequent changes to the working directory wouldn't affect it.
Re:Pip -t: A simple and transparent alternative to virtualen...
by pyre on Thursday June 25, 2015 @01:57PM
(#9779687)
That seems correct:
/tmp $ PYTHONPATH='./test' /usr/bin/python -c 'import sys; print sys.path[:3]'
['', '/private/tmp/test', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip']
Re:Pip -t: A simple and transparent alternative to virtualen...
by JoshTriplett on Thursday June 25, 2015 @08:40PM
(#9781852)
Good to know, thanks.
It's still odd for software to only work when launched from a specific directory, but not necessarily a critical security vulnerability then.
Among other things, what happens if your Python code changes its working directory, then subsequently tries to import a module? Consequences range from "doesn't work" to "introduces a security vulnerability by running arbitrary Python code from an untrusted directory".