[issue15964] SyntaxError in asdl when building 2.7 with system Python 3

Chris Jerdonek report at bugs.python.org
Mon Sep 24 05:37:47 CEST 2012


Chris Jerdonek added the comment:

> So can you find out why asdl_c.py actually printed this error?

I collected some additional information.  Here is the beginning of Parser/asdl_c.py:

#! /usr/bin/env python
"""Generate C code from an ASDL description."""

And in the scenario of this issue I have--

$ python
-bash: /opt/local/Library/Frameworks/Python.framework/Versions/Current/bin/python: No such file or directory

But--

$ /usr/bin/env python -V
Python 3.2.3

Some more data:

$ /usr/bin/env python -c "import sys; print(sys.executable)"
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app/Contents/MacOS/Python
$ echo $PATH
/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/texbin
$ which python
/opt/local/bin/python
$ /opt/local/bin/python -c "import sys; print(sys.executable)"
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app/Contents/MacOS/Python

It's not immediately clear to me why running `python` doesn't find python in the second $PATH entry even though `which python` does.  Also, creating a new terminal doesn't seem to exhibit the same problem, so the error state may not be fully reproducible after all (at least on my machine).

In any case, Christian's work-around does resolve the issue for this particular error state while other solutions don't.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15964>
_______________________________________


More information about the Python-bugs-list mailing list