-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-132063: ProcessPoolExecutor swallows falsy Exceptions #132129
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-132063: ProcessPoolExecutor swallows falsy Exceptions #132129
Conversation
Misc/NEWS.d/next/Library/2025-04-05-15-05-09.gh-issue-132063.KHnslU.rst
Outdated
Show resolved
Hide resolved
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.
I never sent my review.
Misc/NEWS.d/next/Library/2025-04-05-15-05-09.gh-issue-132063.KHnslU.rst
Outdated
Show resolved
Hide resolved
After more tests, I found that Line 1123 in 255eb37
Line 1144 in 255eb37
And falsey BaseExceptionGroup exception is ignored too.Line 1159 in 255eb37
Should we open a new issue with these bugs or integrate them to this PR ? EDIT: please ignore this comment |
Misc/NEWS.d/next/Library/2025-04-05-15-05-09.gh-issue-132063.KHnslU.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
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 nits and LGTM.
|
||
msg = 'boolbool' | ||
with self.assertRaisesRegex(FalseyBoolException, msg): | ||
self.executor.submit(raiser, FalseyBoolException, msg).result() |
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.
This is for a possible follow-up but this kind of call makes me wonder whether the base class shouldn't have some def submit_and_fetch(self)
method that does this.
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.
Does this method return directy the result ?
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 is a follow-up with the TracebackException
class which swallows __cause__
and __context__
content of falsey exceptions.
I will post a new issue about this.
…alsey exceptions (pythonGH-132129) (cherry picked from commit 933c665) Co-authored-by: Duprat <[email protected]>
GH-132275 is a backport of this pull request to the 3.13 branch. |
…alsey exceptions (python#132129)
ProcessPoolExecutor and ThreadPoolExecutor swallows falsy exception.
Fix tests about exception variable in 2 files of /Lib/concurrent/futures
Changes 2 tests as below:
Replace
if exception:
withif exception is not None: