[issue24960] Can't use lib2to3 with embeddable zip file.

Gregory P. Smith report at bugs.python.org
Sun May 21 14:03:21 EDT 2017


Gregory P. Smith added the comment:

re: Paul's "I'm not sure I see why you'd want to run lib2to3 with the embedded distribution anyway. Surely you'd do any 2to3 conversion in a normal development installation"

lib2to3 is a library useful for doing things with Python code.  Not just a stand alone tool.

Kirk: Could you please post your change as a pull request on https://github.com/python/cpython/ rather than attaching individual files here.  a full file isn't a reviewable change.

Also, Grammar.txt is loaded and saved as a cached pickle file for speed.  When packaging up an embedded stdlib bundle I recommend shipping that pickle.  (loaded in pgen2/grammar.py).

both probably need to use https://docs.python.org/3.6/library/pkgutil.html#pkgutil.get_data to read the file out of the package rather than assuming it lives on a filesystem.

using the zipfile module within lib2to3 to try and figure out when it should look somewhere other than a filesystem is the wrong approach.

----------
nosy: +gregory.p.smith
stage:  -> needs patch
versions: +Python 3.6, Python 3.7

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


More information about the Python-bugs-list mailing list