-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files #4977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist.
Should this ultimately use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is I believe this is correct. Don't let the importlib.resources question hold you back, as this is the form the change will need backporting to 3.6 and 2.7 in anyways.
Thanks @benjaminp for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6. |
…les (pythonGH-4977) This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist. (cherry picked from commit 8a58771)
GH-4979 is a backport of this pull request to the 3.6 branch. |
Sorry, @benjaminp, I could not cleanly backport this to |
GH-4980 is a backport of this pull request to the 2.7 branch. |
…mar files (GH-4977) This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist.. (cherry picked from commit 8a58771)
…les (GH-4977) (#4979) This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist. (cherry picked from commit 8a58771)
…mar files (GH-4977) (#4980) This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist.. (cherry picked from commit 8a58771)
This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist.
https://bugs.python.org/issue24960