The test should be: if self._exception is not None: because if self._exception calls the bool method of exception.
Well spotted. Indeed, this should be changed to is not None. More generally, are there other places in the stdlib (or in mp-related code) where we have this issue?
Unless they can make a silly bug, I think it's fine to keep them. However, unless @graingert wants to work on the issue itself, you may first fix the __get_result method first.
Activity
YvesDup commented on Apr 4, 2025
I think there is something wrong here in the __get_result(self) method of Future class:
cpython/Lib/concurrent/futures/_base.py
Lines 393 to 400 in 6ab4ace
The test should be: if self._exception is not None: because if self._exception calls the __bool__ method of exception.
Edit: same problem here on line 443
cpython/Lib/concurrent/futures/process.py
Lines 441 to 446 in 6ab4ace
picnixz commented on Apr 4, 2025
Well spotted. Indeed, this should be changed to is not None. More generally, are there other places in the stdlib (or in mp-related code) where we have this issue?
YvesDup commented on Apr 4, 2025
I saw these tests this morning:
cpython/Lib/traceback.py
Line 1123 in 255eb37
cpython/Lib/traceback.py
Line 1144 in 255eb37
cpython/Lib/traceback.py
Line 1159 in 255eb37
May I open a PR ?
picnixz commented on Apr 4, 2025
Unless they can make a silly bug, I think it's fine to keep them. However, unless @graingert wants to work on the issue itself, you may first fix the __get_result method first.
YvesDup commented on Apr 4, 2025
It's mandatory to work on both files /Lib/concurrent/futures/process.py and /Lib/concurrent/futures/_base.pyto fix this issue.
This should fix the same issue with a ThreadPoolExcecutor.
graingert commented on Apr 4, 2025
gh-132063: ensure that `ProcessPoolExecutor` does not swallow falsey …
pythongh-132063: ensure that `ProcessPoolExecutor` does not swallow f…
[3.13] gh-132063: ensure that `ProcessPoolExecutor` does not swallow …