-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-45848: Allow the parser to get error lines from encoded files #29646
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
Conversation
e5f98dd
to
d97d5d8
Compare
error_line = PyErr_ProgramTextObject(p->tok->filename, (int) lineno); | ||
else if (p->start_rule == Py_file_input) { | ||
error_line = _PyErr_ProgramDecodedTextObject(p->tok->filename, | ||
(int) lineno, p->tok->encoding); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌🏻
Thanks @pablogsal for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
Sorry, @pablogsal and @ambv, I could not cleanly backport this to |
Sorry @pablogsal and @ambv, I had trouble checking out the |
…les (pythonGH-29646). (cherry picked from commit fdcc46d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
GH-29661 is a backport of this pull request to the 3.10 branch. |
@pablogsal, backporting this to 3.9 is more involved as the parser is much simpler in this case, see: Lines 424 to 434 in e8d41ee
There is no Let me know if you'd like me to still proceed with the backport. The current 3.11 crasher doesn't produce too terrible of a result under 3.9:
|
Thanks @ambv ! I will give it a go but as this doesn't crash in 3.9 I'm ok to just leave as is, as in this way we can also avoid potential unintended side effects in 3.9. |
https://bugs.python.org/issue45848