Skip to content

gh-137716: TracebackException to handle messages with punctuation#138111

Open
krisztian-gajdar wants to merge 19 commits into
python:mainfrom
krisztian-gajdar:traceback-to-handle-error-msgs-with-period
Open

gh-137716: TracebackException to handle messages with punctuation#138111
krisztian-gajdar wants to merge 19 commits into
python:mainfrom
krisztian-gajdar:traceback-to-handle-error-msgs-with-period

Conversation

@krisztian-gajdar

@krisztian-gajdar krisztian-gajdar commented Aug 24, 2025

Copy link
Copy Markdown

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

@python-cla-bot

python-cla-bot Bot commented Aug 24, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

@bedevere-app

bedevere-app Bot commented Aug 24, 2025

Copy link
Copy Markdown

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.

Comment thread Lib/traceback.py Outdated

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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:

Comment thread Lib/traceback.py Outdated
Comment thread Lib/traceback.py Outdated
Comment thread Lib/traceback.py Outdated
Comment thread Lib/traceback.py Outdated
Comment thread Lib/traceback.py Outdated
@picnixz

picnixz commented Aug 24, 2025

Copy link
Copy Markdown
Member

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.

@krisztian-gajdar

Copy link
Copy Markdown
Author

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.

@bedevere-app

bedevere-app Bot commented Aug 24, 2025

Copy link
Copy Markdown

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.
@krisztian-gajdar krisztian-gajdar force-pushed the traceback-to-handle-error-msgs-with-period branch from e71d03b to 686051c Compare August 24, 2025 12:34
@AA-Turner

Copy link
Copy Markdown
Member

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

@picnixz

picnixz commented Aug 24, 2025

Copy link
Copy Markdown
Member

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.

@krisztian-gajdar

Copy link
Copy Markdown
Author

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.

@hugovk hugovk removed their request for review August 25, 2025 16:07
@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@bedevere-app

bedevere-app Bot commented Sep 7, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

: please review the changes made to this pull request.

@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@AA-Turner

Copy link
Copy Markdown
Member

Yes, please resolve conflicts.

A

krisztian-gajdar and others added 3 commits October 31, 2025 08:05
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.
@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@AA-Turner

AA-Turner commented Nov 2, 2025

Copy link
Copy Markdown
Member

please proceed with the merge. 🙏

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

A

@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@AA-Turner

Copy link
Copy Markdown
Member

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

A

@krisztian-gajdar

Copy link
Copy Markdown
Author

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

@krisztian-gajdar

Copy link
Copy Markdown
Author

@AA-Turner @ezio-melotti Following up: I believe all prior review threads are now addressed and CI is green.
Main functional change is still limited to TracebackException punctuation handling for gh-137716.
If you still see any outstanding thread you want handled differently, please point to it and I’ll modify.

krisztian-gajdar and others added 3 commits January 26, 2026 16:45
… suggestion formatting

Move ModuleNotFoundError stdlib module detection into the unified
suggestion handling block, removing duplicate exception handling code.

Also fix the site initialization disabled message to include virtual
environment hint and add proper handling for non-ASCII suggestion names
in the _suggestion_message function.
@krisztian-gajdar

Copy link
Copy Markdown
Author

@AA-Turner @ezio-melotti Hey, what should I do to get this branch merged?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants