gh-151238: Check for _get_resized_exprs failure in _PyPegen_{joined,template}_str#151259
Open
StanFromIreland wants to merge 1 commit into
Open
gh-151238: Check for _get_resized_exprs failure in _PyPegen_{joined,template}_str#151259StanFromIreland wants to merge 1 commit into
_get_resized_exprs failure in _PyPegen_{joined,template}_str#151259StanFromIreland wants to merge 1 commit into
Conversation
_get_resized_exprs failure in _PyPegen_{joined,template}_str_get_resized_exprs failure in _PyPegen_{joined,template}_str
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.
There are several cases where
_get_resized_exprscan fail and return NULL (all of which are quite rare, however):cpython/Parser/action_helpers.c
Lines 1341 to 1344 in e2bd50d
cpython/Parser/action_helpers.c
Lines 1362 to 1368 in e2bd50d
cpython/Parser/action_helpers.c
Lines 1347 to 1351 in e2bd50d
cpython/Parser/action_helpers.c
Lines 1401 to 1404 in e2bd50d
And the one triggered by the reproducer in the issue (which I test):
cpython/Parser/action_helpers.c
Lines 1383 to 1386 in e2bd50d
_PyPegen_decode_fstring_partreturns NULL because it calls_PyPegen_decode_stringwhich in turn callswarn_invalid_escape_sequencewhich triggers the failure as it tries to import modules to issue a warning, but gets aTypeError.