[pull] main from python:main - #1323
Merged
Merged
Conversation
…eue wait paths (GH-154837) The event-driven wait introduced by gh-83069 passes the caller's timeout unclamped to poll() / kqueue.control(), so values that do not fit the C timestamp conversion (float('inf'), sys.maxsize, 1e10, ...) raise OverflowError on Linux and, on macOS/BSD, a misleading "TypeError: timeout must be a real number or None" -- all of which worked on 3.14 and earlier. - Lib/subprocess.py: clamp each wait to _MAXIMUM_WAIT_TIMEOUT (24h, following asyncio's MAXIMUM_SELECT_TIMEOUT precedent) and loop until the real deadline in both _wait_pidfd() and _wait_kqueue(). - Modules/selectmodule.c: only rewrite the kqueue.control() timeout conversion failure into TypeError when the original exception IS a TypeError, exactly like the select()/poll()/devpoll()/epoll() sites, so OverflowError surfaces for out-of-range values. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Currently if you have a generator like:
```
async def test():
async with asyncio.TaskGroup() as tg:
async for x in whatever():
yield x
```
If aclose() is called on the generator and GeneratorExit is raised,
the TaskGroup's __aexit__ will raise a BaseExceptionGroup, and that
will be raised from the aclose() call instead of it being swallowed.
Fix this by raising GeneratorExit from __aexit__ when:
1. The body of task group raised it
2. No subtasks raised exceptions
This makes GeneratorExit work without swallowing other exceptions
(like it would if we just added it to _is_base_error).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )