Message99515
This test seems to trigger an issue in site.py, adding '-v' to the code that starts the interpreter in test_platform.py gives the following output (amongst a lot more text that doesn't seem to be relevant):
'import site' failed; traceback:
Traceback (most recent call last):
File "/Users/ronald/Projects/python/python-trunk/build/../Lib/site.py", line 530, in <module>
main()
File "/Users/ronald/Projects/python/python-trunk/build/../Lib/site.py", line 509, in main
addbuilddir()
File "/Users/ronald/Projects/python/python-trunk/build/../Lib/site.py", line 118, in addbuilddir
s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
File "/Users/ronald/Projects/python/python-trunk/Lib/sysconfig.py", line 577, in get_platform
cfgvars = get_config_vars()
File "/Users/ronald/Projects/python/python-trunk/Lib/sysconfig.py", line 402, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/Users/ronald/Projects/python/python-trunk/Lib/sysconfig.py", line 255, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/local/lib/python2.7/config/Makefile (No such file or directory)
The root cause is that test_architecture_via_symlink starts python through a symlink, and that confuses the sysconfig module because that tries to detect if it is running in the build tree by looking for a file relative to sys.executable, without resolving symlinks.
A simple patch to sysconfig seems to fix the issue:
-_PROJECT_BASE = abspath(os.path.dirname(sys.executable))
+_PROJECT_BASE = abspath(os.path.dirname(os.path.realpath(sys.executable)))
(also attached as a proper patch).
I'm adding tarek because he added Lib/sysconfig.py.
Tarek: could you please review the patch? |
|
Date |
User |
Action |
Args |
2010-02-18 16:06:29 | ronaldoussoren | set | recipients:
+ ronaldoussoren, mark.dickinson, tarek |
2010-02-18 16:06:29 | ronaldoussoren | set | messageid: <1266509189.09.0.764919643006.issue7958@psf.upfronthosting.co.za> |
2010-02-18 16:06:27 | ronaldoussoren | link | issue7958 messages |
2010-02-18 16:06:27 | ronaldoussoren | create | |
|