Martin Panter added the comment:

I occasionally get the following error, due to Parser/parsetok.o being older 
than Include/graminit.h.

./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; then  
echo "generate-posix-vars failed" ;  rm -f ./pybuilddir.txt ;  exit 1 ;  fi
Could not import runpy module
Traceback (most recent call last):
  File "/home/proj/python/cpython/Lib/runpy.py", line 14, in <module>
    import importlib.machinery # importlib first so we can test #15386 via -m
  File "/home/proj/python/cpython/Lib/importlib/__init__.py", line 57, in 
<module>
    import types
  File "/home/proj/python/cpython/Lib/types.py", line 166, in <module>
    import functools as _functools
  File "/home/proj/python/cpython/Lib/functools.py", line 345, in <module>
    _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", 
"currsize"])
  File "/home/proj/python/cpython/Lib/collections/__init__.py", line 428, in 
namedtuple
    exec(class_definition, namespace)
SystemError: invalid node 339 for PyAST_FromNode
generate-posix-vars failed
*** Error code 1

The best workaround for me (less brute force than removing the whole build 
tree) seems to be to add Parser/parsetok.c to the list of files to “touch” the 
timestamps of before building.

The dependency in Parser/parsetok.c on Include/graminit.h was added by 
<https://hg.python.org/cpython/diff/06f1e2fd05bc/Parser/parsetok.c>, presumably 
to support encoding declarations in Python source files. I haven’t tried, but 
perhaps to avoid pgen depending on its output, a quick fix would be to add 
#ifndef PGEN around the offending code. For Python 2, a Parser/parsetok_pgen.c 
wrapper file would have to added, like in revision 6e9dc970ac0e.

----------
nosy: +martin.panter

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4347>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to