fix: replace invalid escape sequences in astparser.py#86
Open
Bindkushal wants to merge 1 commit intosugarlabs:masterfrom
Open
fix: replace invalid escape sequences in astparser.py#86Bindkushal wants to merge 1 commit intosugarlabs:masterfrom
Bindkushal wants to merge 1 commit intosugarlabs:masterfrom
Conversation
|
Is this related to the recent issues? Can you please review #83 too? Thanks. |
Author
Author
|
@quozl I reviewed #83 and the update #85 carefully. While the raw string approach is valid, it also modifies AST handling and introduces an unreachable elif isinstance(node, ast.Constant) check on line 496 — the first ast.Constant branch already handles all cases. elif isinstance(node, ast.Constant): elif isinstance(node, ast.Constant) and isinstance(node.value, str): original cantorl flow was fine, in his updated #85 . The second elif can never be reached — it checks ast.Constant again but the first one already catches all ast.Constant nodes. Dead code. That's a bug he introduced. |
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.
Fixes SyntaxWarning on Python 3.12+ where '.' in regular string
literals is treated as invalid escape sequence.
Changed '.' to '\.' in FLOAT_REGEXP_STR and RANGE_REGEXP.