cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-137716: TracebackException to handle messages with punctuation

Open krisztian-gajdar opened this issue 4 months ago • 31 comments

Added extra handling for error messages with punctuation to avoid double punctuations and eliminated code duplication

  • Issue: gh-137716

krisztian-gajdar avatar Aug 24 '25 09:08 krisztian-gajdar

All commit authors signed the Contributor License Agreement.

CLA signed

python-cla-bot[bot] avatar Aug 24 '25 09:08 python-cla-bot[bot]

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.

bedevere-app[bot] avatar Aug 24 '25 09:08 bedevere-app[bot]

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.

picnixz avatar Aug 24 '25 11:08 picnixz

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.

krisztian-gajdar avatar Aug 24 '25 12:08 krisztian-gajdar

Thanks for making the requested changes!

: please review the changes made to this pull request.

bedevere-app[bot] avatar Aug 24 '25 12:08 bedevere-app[bot]

This PR contains several unrelated changes, please revert all of these.

AA-Turner avatar Aug 24 '25 12:08 AA-Turner

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.

picnixz avatar Aug 24 '25 12:08 picnixz

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.

krisztian-gajdar avatar Aug 24 '25 12:08 krisztian-gajdar

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.

And if you don't make the requested changes, you will be put in the comfy chair!

bedevere-app[bot] avatar Aug 26 '25 01:08 bedevere-app[bot]

@AA-Turner I have made the requested changes; please review again

krisztian-gajdar avatar Aug 26 '25 04:08 krisztian-gajdar

Thanks for making the requested changes!

@AA-Turner: please review the changes made to this pull request.

bedevere-app[bot] avatar Aug 26 '25 04:08 bedevere-app[bot]

Is there anything I can do on my side?

krisztian-gajdar avatar Aug 29 '25 15:08 krisztian-gajdar

Could you actually add a test where the message ends with punctuations?

picnixz avatar Aug 29 '25 15:08 picnixz

@picnixz I have added test covering all for cases for the puctuation

krisztian-gajdar avatar Aug 29 '25 17:08 krisztian-gajdar

Please fix the tests.

picnixz avatar Aug 29 '25 18:08 picnixz

@picnixz fixed

krisztian-gajdar avatar Aug 29 '25 19:08 krisztian-gajdar

@picnixz I have made the requested changes; please review again.

krisztian-gajdar avatar Aug 30 '25 11:08 krisztian-gajdar

Thanks for making the requested changes!

@AA-Turner: please review the changes made to this pull request.

bedevere-app[bot] avatar Aug 30 '25 11:08 bedevere-app[bot]

@picnixz, @AA-Turner Is there anything else I should do?

krisztian-gajdar avatar Sep 02 '25 04:09 krisztian-gajdar

@picnixz, @AA-Turner Is there anything else I should do?

Just checking in, let me know if I can help move this forward 🙏

krisztian-gajdar avatar Sep 06 '25 19:09 krisztian-gajdar

@picnixz I have made the requested changes; please review again.

krisztian-gajdar avatar Sep 07 '25 09:09 krisztian-gajdar

Thanks for making the requested changes!

: please review the changes made to this pull request.

bedevere-app[bot] avatar Sep 07 '25 09:09 bedevere-app[bot]

Thank you @picnixz for the approve. @AA-Turner what are the next steps?

krisztian-gajdar avatar Sep 08 '25 07:09 krisztian-gajdar

@picnixz @AA-Turner do I need to update, or resolve conflicts?

krisztian-gajdar avatar Oct 30 '25 10:10 krisztian-gajdar

Yes, please resolve conflicts.

A

AA-Turner avatar Oct 30 '25 10:10 AA-Turner

@AA-Turner conflicts have been resolved, please proceed with the merge. 🙏

krisztian-gajdar avatar Nov 02 '25 20:11 krisztian-gajdar

please proceed with the merge. 🙏

I still have outstanding review comments above, please let me know if it's been resolved.

A

AA-Turner avatar Nov 02 '25 20:11 AA-Turner

All of them has been resolved as I see, please let me know if it's not the case.

krisztian-gajdar avatar Nov 02 '25 20:11 krisztian-gajdar

Thank you. In the future, please add a comment after each review suggestion noting if/how it has been resolved.

A

AA-Turner avatar Nov 02 '25 20:11 AA-Turner

@AA-Turner I wrote it down, thank you!

krisztian-gajdar avatar Nov 02 '25 20:11 krisztian-gajdar