Repository navigation
PEG Parser: Invalid targets for augassign and except succeed #84798
Copy link
Copy link
Closed
Labels
3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Tuples and lists, which are invalid augmented assignment targets, currently get successfully parsed, without failing.
➜ cpython git:(targets-fix) ✗ ./python -X oldparser Python 3.9.0a6+ (heads/master-dirty:75cd8e48c6, May 14 2020, 03:01:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> (a, b) += (1, 2) File "<stdin>", line 1 SyntaxError: illegal expression for augmented assignment ➜ cpython git:(pr/20076) ./python Python 3.9.0a6+ (heads/pr/20076:bcf5be2772, May 14 2020, 02:15:37) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> (a, b) += 1 SystemError: invalid node type (26) for augmented assignment
We also accept arbitrary targets in
exceptclauses, while we should only be accepting NAME nodes:➜ cpython git:(master) ./python Python 3.9.0a6+ (heads/master:75cd8e48c6, May 14 2020, 03:14:03) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> try: ... pass ... except Exception as a.b: ... pass ... [1] 135956 segmentation fault (core dumped) ./python
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error3.9 (EOL)end of lifeend of life
on May 14, 2020 - addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on May 14, 2020
Metadata
Metadata
Assignees
Labels
3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: