This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients mark.dickinson, ronaldoussoren, tarek
Date 2010-02-18.16:06:26
SpamBayes Score 1.4584445e-12
Marked as misclassified No
Message-id <1266509189.09.0.764919643006.issue7958@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2010-02-18 16:06:29ronaldoussorensetrecipients: + ronaldoussoren, mark.dickinson, tarek
2010-02-18 16:06:29ronaldoussorensetmessageid: <1266509189.09.0.764919643006.issue7958@psf.upfronthosting.co.za>
2010-02-18 16:06:27ronaldoussorenlinkissue7958 messages
2010-02-18 16:06:27ronaldoussorencreate