classification
Title: sysconfig does not like symlinks
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tarek Nosy List: ezio.melotti, flox, pitrou, tarek
Priority: high Keywords: patch

Created on 2010-02-07 23:22 by flox, last changed 2010-03-23 11:48 by flox. This issue is now closed.

Files
File name Uploaded Description Edit
issue7880_sysconfig.diff flox, 2010-02-07 23:47 Patch, apply to trunk
Messages (8)
msg99027 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-07 23:22
~ $ cd /tmp
 ~ $ ln -s /usr/local/bin/python .
 ~ $ ./python -c "import sys; print sys.executable"
'import site' failed; use -v for traceback
/tmp/python
msg99028 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-02-07 23:28
Here's the traceback, I'll look at the problem asap

'import site' failed; traceback:
Traceback (most recent call last):
  File "/MacDev/svn.python.org/python-trunk/Lib/site.py", line 530, in <module>
    main()
  File "/MacDev/svn.python.org/python-trunk/Lib/site.py", line 509, in main
    addbuilddir()
  File "/MacDev/svn.python.org/python-trunk/Lib/site.py", line 118, in addbuilddir
    s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
  File "/MacDev/svn.python.org/python-trunk/Lib/sysconfig.py", line 577, in get_platform
    cfgvars = get_config_vars()
  File "/MacDev/svn.python.org/python-trunk/Lib/sysconfig.py", line 402, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/MacDev/svn.python.org/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)
msg99029 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-07 23:43
proposed fix.
msg99030 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-07 23:47
actually realpath == abspath on most platforms where symlink is not implemented.

Changed.
msg99112 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-02-09 12:05
Why would sys.executable be a directory?
msg99113 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-02-09 12:15
Antoine, see http://bugs.python.org/issue7774
msg99114 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-09 12:19
Yes, it is the issue #7774.

The patch proposed on msg98284 should fix sys.executable being a directory.

Tarek, if you implement the patch for sysconfig, add a note regarding the dir hack:
  # XXX : see issue 7774
msg100818 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-03-11 00:09
Fixed in r78828 and r78829 (py3k), except for the part related to #7774.

(It was turning buildbots red, after Victor fixed #3137)
History
Date User Action Args
2010-03-23 11:48:42floxsetstatus: pending -> closed
2010-03-11 00:09:34floxsetstatus: open -> pending
resolution: fixed
messages: + msg100818

stage: patch review -> resolved
2010-02-09 12:19:25floxsetmessages: + msg99114
2010-02-09 12:15:03tareksetmessages: + msg99113
2010-02-09 12:05:47pitrousetnosy: + pitrou
messages: + msg99112
2010-02-07 23:47:44floxsetfiles: + issue7880_sysconfig.diff

messages: + msg99030
2010-02-07 23:46:35floxsetfiles: - issue7880_sysconfig.diff
2010-02-07 23:43:31floxsetstage: patch review
2010-02-07 23:43:18floxsetfiles: + issue7880_sysconfig.diff
keywords: + patch
messages: + msg99029
2010-02-07 23:28:43tareksetmessages: + msg99028
2010-02-07 23:26:18tareksetpriority: normal -> high
2010-02-07 23:22:10floxcreate