bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files#4977
Merged
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files#4977
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.
Member
|
Should this ultimately use |
gpshead
approved these changes
Dec 22, 2017
Member
gpshead
left a comment
There was a problem hiding this comment.
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.
Contributor
|
Thanks @benjaminp for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 22, 2017
…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. |
Contributor
|
Sorry, @benjaminp, I could not cleanly backport this to |
|
GH-4980 is a backport of this pull request to the 2.7 branch. |
benjaminp
added a commit
that referenced
this pull request
Dec 22, 2017
…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)
benjaminp
pushed a commit
that referenced
this pull request
Dec 22, 2017
…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)
benjaminp
added a commit
that referenced
this pull request
Dec 22, 2017
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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