- 
 
 - 
  Notifications
 
You must be signed in to change notification settings  - Fork 33.3k
 
gh-137716: TracebackException to handle messages with punctuation #138111
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
gh-137716: TracebackException to handle messages with punctuation #138111
Conversation
All commit authors signed the Contributor License Agreement.
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.
There seems to be too many changes. Please revert unrelated changes and code refactoring.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
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.
Ok for the refactoring (no need for additional tests). However here are some suggestions for readability:
I'm still unusure about whether to rstrip() or not. I said "no" for now but it could be helpful. On one's hand, if a (custom) exception message ends with a new line for readability purposes, it would be better not to add the punctuation as well and use a fresh new line.
I have made the requested changes; please review again
Thank you for reconsideration of the proposed refactor.
I think we can safely consider exception messages ending with a new line out of scope for this use case.
Thanks for making the requested changes!
: please review the changes made to this pull request.
...tuations docs: add news entry for TracebackException punctuation fix style: remove trailing whitespace in traceback.py Update 2025年08月24日-11-42-38.gh-issue-137716.7-Mtj-.rst Update 2025年08月24日-11-42-38.gh-issue-137716.7-Mtj-.rst refactor: improve suggestion message computation and punctuation handling style: remove trailing whitespace in traceback.py pythongh-137986: Fix and improve the csv functions docstrings (pythonGH-137987) The csv.register_dialect() docstring no longer imply that it returns a dialect. All functions have now signatures. Co-authored-by: maurycy <5383+maurycy@users.noreply.github.com> pythongh-135261: bring back CI job for testing OpenSSL 1.1.1w (python#135262) This partially reverts commit d83e30c by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this version being upstream EOL, the rationale for keeping it as follows: - It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors. - Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later is recommended for cryptographic modules. Since changing the build requirements requires a transition period, we need to keep testing the allowed versions. - The code base still contains calls to OpenSSL functions that are deprecated since OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.
e71d03b to
 686051c  
 Compare
 
 This PR contains several unrelated changes, please revert all of these.
This PR contains several unrelated changes, please revert all of these.
I thought so but I think it's necessary (the changes are a simple refactorization to simplify the handling). As for the blank lines being removed, we can revert them or keep them.
EDIT: NVM, it's the merge commit that messed up the review. @krisztian-gajdar Please avoid force-pushing, it makes incremental review harder.
NVM, it's the merge commit that messed up the review. @krisztian-gajdar Please avoid force-pushing, it makes incremental review harder.
Yep, fixed. sorry for the inconvenience.
@picnixz, @AA-Turner Is there anything else I should do?
@picnixz, @AA-Turner Is there anything else I should do?
Just checking in, let me know if I can help move this forward 🙏
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.
Some refactoring suggestions.
@picnixz I have made the requested changes; please review again.
Thanks for making the requested changes!
: please review the changes made to this pull request.
Thank you @picnixz for the approve. @AA-Turner what are the next steps?
@picnixz @AA-Turner do I need to update, or resolve conflicts?
Yes, please resolve conflicts.
A
Remove "Did you mean" suggestions and import prompts from NameError and AttributeError exception handling in traceback formatting. This eliminates automatic suggestion text that was being appended to error messages.
@AA-Turner conflicts have been resolved, please proceed with the merge. 🙏
please proceed with the merge. 🙏
I still have outstanding review comments above, please let me know if it's been resolved.
A
All of them has been resolved as I see, please let me know if it's not the case.
Thank you. In the future, please add a comment after each review suggestion noting if/how it has been resolved.
A
@AA-Turner I wrote it down, thank you!
Uh oh!
There was an error while loading. Please reload this page.
Added extra handling for error messages with punctuation to avoid double punctuations and eliminated code duplication