Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles#98459

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 8 commits intopython:mainfromAlexTate:issue-98458
Dec 4, 2022

Conversation

AlexTate
Copy link
Contributor

@AlexTateAlexTate commentedOct 19, 2022
edited by bedevere-bot
Loading

…ed exception in TestResult._clean_tracebacks()
@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@ghost
Copy link

ghost commentedOct 19, 2022
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

Copy link
Member

@zwarezware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add a test for this? It would be good to also test the more exotic case of a loop of mutually-chained exceptions, such as:

try:raiseValueError(1)exceptValueErrorase:try:raiseKeyError(2)fromeexceptKeyErrorase2:raiseefrome2

Copy link
Contributor

@kumaraditya303kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please add a test for this and address@iritkatriel's review.

@bedevere-bot
Copy link

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 phraseI 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.

…cks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)
@AlexTate
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@kumaraditya303: please review the changes made to this pull request.

@AlexTateAlexTate changed the titlegh-98458: unittest: bugfix for infinite loop while handling self-referencing explicit exceptiongh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cyclesDec 2, 2022
Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good, I'd add another test.

Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM.

@gpshead - as a maintainer of unittest, do you want to backport this?

@iritkatrieliritkatriel added type-bugAn unexpected behavior, bug, or error stdlibPython modules in the Lib dir labelsDec 4, 2022
@gpsheadgpshead added needs backport to 3.10only security fixes needs backport to 3.11only security fixes labelsDec 4, 2022
@gpsheadgpshead merged commit72ec518 intopython:mainDec 4, 2022
@miss-islington
Copy link
Contributor

Thanks@AlexTate for the PR, and@gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-99995 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelDec 4, 2022
@bedevere-bot
Copy link

GH-99996 is a backport of this pull request to the3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10only security fixes labelDec 4, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestDec 4, 2022
…ined exceptions that contain cycles (pythonGH-98459)* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes(cherry picked from commit72ec518)Co-authored-by: AlexTate <0xalextate@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestDec 4, 2022
…ined exceptions that contain cycles (pythonGH-98459)* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes(cherry picked from commit72ec518)Co-authored-by: AlexTate <0xalextate@gmail.com>
miss-islington added a commit that referenced this pull requestDec 4, 2022
…xceptions that contain cycles (GH-98459)* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes(cherry picked from commit72ec518)Co-authored-by: AlexTate <0xalextate@gmail.com>
miss-islington added a commit that referenced this pull requestDec 4, 2022
…xceptions that contain cycles (GH-98459)* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes(cherry picked from commit72ec518)Co-authored-by: AlexTate <0xalextate@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zwarezwarezware left review comments

@gpsheadgpsheadgpshead approved these changes

@iritkatrieliritkatrieliritkatriel approved these changes

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303

Assignees
No one assigned
Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Unittest: self-referencing explicit exception cause results in infinite loop
7 participants
@AlexTate@bedevere-bot@miss-islington@gpshead@iritkatriel@zware@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp