[issue15822] installed python may fail incorrectly trying to rebuild lib2to3 grammar pickles

Martin v. Löwis report at bugs.python.org
Fri Sep 7 19:46:18 CEST 2012


Martin v. Löwis added the comment:

I think the patch for issue 15645 was incorrect. Instead of generating the pickles in the source tree and copying them, it should have arranged lib2to3 to generate them in the target directory instead (just as all the compileall invocations also generate files in LIBDEST).

There are multiple ways to achieve this. The least intrusive (perhaps) is to insert "$(DESTDIR)$(LIBDEST)" into sys.path before importing lib2to3 in the Makefile.

The approach that I suggest is to make lib2to3.pgen2.driver a script which expects a .txt path, and generates a pickle next to it, so the installation would do

$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt

----------
nosy: +loewis

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


More information about the Python-bugs-list mailing list