[go: nahoru, domu]

Skip to content
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

Ensure the position information in AST nodes created by the parser is always consistent #93351

Closed
pablogsal opened this issue May 30, 2022 · 2 comments · Fixed by #93352
Closed
Labels
3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pablogsal
Copy link
Member

If we create an AST node with invalid position information, the error is reported in the compiler when it validates the line numbers and end line numbers, which is too far away and debugging this can be quite challenging. To improve the debugging experience, ensure that the parser cannot create an AST node with invalid position information.

@AA-Turner AA-Turner added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.11 only security fixes 3.10 only security fixes 3.12 bugs and security fixes labels May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit that referenced this issue May 30, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2022
…by the parser is always consistent (pythonGH-93352)

(cherry picked from commit 5893b5d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
miss-islington added a commit that referenced this issue May 30, 2022
… parser is always consistent (GH-93352)

(cherry picked from commit 5893b5d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@hauntsaninja
Copy link
Contributor

This broke a project of mine https://github.com/hauntsaninja/pyp that does some AST tricks. Worth adding a news entry (possibly to Python 3.11 What's New as well)?

@pablogsal
Copy link
Member Author

I will add a news entry for this

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 23, 2022
…thongh-93351 (pythonGH-95175)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue Jul 23, 2022
…s in pythongh-93351 (pythonGH-95175)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this issue Jul 23, 2022
…h-93351 (GH-95175) (#95178)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
ambv pushed a commit that referenced this issue Jul 26, 2022
…GH-95175) (GH-95177)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
3 participants