
Feb. 7, 2010
12:04 a.m.
Guido van Rossum wrote:
What we do instead, is code in site.py that walks over the elements of sys.path and turns them into absolute paths. However this code runs before '' is inserted in the front of sys.path, so that the initial value of sys.path is ''.
You may want to print the value of sys.path at various points to see for yourself.
I ran into the issue on Debian or Ubuntu (can't remember) several years ago. The post-install script of the Python package did something like "cd /usr/lib/pythonX.Y && ./compileall.py", so all pyc files were created relative to the library root of Python. The __file__ attribute of all pre-compiled Python files were relative, too. Christian