-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-42864: Improve error messages regarding unclosed parentheses #24161
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
I opened this as a draft to evaluate the idea. This probably needs #24140 to be fixed first for the tests to pass |
cc: @asottile |
823ba3e
to
83572fc
Compare
@lysnikolaou Do you mind taking a look at this when you have some time? I hope we can find some way to make this work 🤞 |
@@ -160,7 +160,6 @@ def test_incomplete(self): | |||
ai("","eval") | |||
ai("\n","eval") | |||
ai("(","eval") | |||
ai("(\n\n\n","eval") |
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.
The EOF was reached in a different line before but now it raises the same error as the case without newlines (because the unopen parentheses are at the same place). I think we can allow that to happen.
2a7d535
to
b5bfa50
Compare
I would like this PR to be exposed as soon as possible to new users testing 3.10 so we can find as many problems with this as possible (if there are any), given that this actively exercises the code added in #24140. If nobody can review this by the end of the week I would like to go ahead and land it and we can tweak it later unless someone has concerns with this. |
I'm so sorry for not replying sooner. I got distracted by other stuff and forgot about this. I'll find some time to review it by Wednesday evening. I hope that's okay and sorry again. |
Absolutely! Don't worry, I totally understand and there is no problem. Also, don't feel pressured to review this if you don't have time. I wrote the message in case that nobody has time to review this in the short term because I wanted some early exposure for this :) Also, tell me if you need more time to go through this and I can hold it for more time |
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.
LGTM! 🚀 Great work!
Do the Windows warnings bother us or is it okay to merge with those?
I would merge and then investigate the proper way to fix it. It probably requires a cast or changing the type of the parent stack but maybe it requires changes somewhere else due to type inconsistency across these fields and I prefer to investigate separately if that's ok with you :) |
Yup. Go! |
Let's see how many weird edge cases we found after this 😆 |
https://bugs.python.org/issue42864
With this PR: