Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ed exception in TestResult._clean_tracebacks()
bedevere-bot commentedOct 19, 2022
Most changes to Pythonrequire a NEWS entry. Please add it using theblurb_it web app or theblurb command-line tool. |
ghost commentedOct 19, 2022 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
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.
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
Uh oh!
There was an error while loading.Please reload this page.
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.
Please add a test for this and address@iritkatriel's review.
bedevere-bot commentedNov 27, 2022
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 |
…cks. The "seen" set follows the approach used in the TracebackException class (thank you@iritkatriel for pointing it out)
I have made the requested changes; please review again |
bedevere-bot commentedDec 1, 2022
Thanks for making the requested changes! @kumaraditya303: please review the changes made to 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.
Looks good, I'd add another test.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…olds a self-loop in its __cause__ and __context__ attributes
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.
@gpshead - as a maintainer of unittest, do you want to backport this?
bedevere-bot commentedDec 4, 2022
GH-99995 is a backport of this pull request to the3.11 branch. |
bedevere-bot commentedDec 4, 2022
GH-99996 is a backport of this pull request to the3.10 branch. |
…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>
…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>
…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>
…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>
Uh oh!
There was an error while loading.Please reload this page.
Closes#98458