Skip to content

[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968)#127003

Merged
vstinner merged 4 commits into
python:3.12from
miss-islington:backport-b3687ad-3.12
Dec 3, 2024
Merged

[3.12] gh-126876: Fix socket internal_select() for large timeout (GH-126968)#127003
vstinner merged 4 commits into
python:3.12from
miss-islington:backport-b3687ad-3.12

Conversation

@miss-islington

@miss-islington miss-islington commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad)

Co-authored-by: Victor Stinner vstinner@python.org

…onGH-126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad)

Co-authored-by: Victor Stinner <vstinner@python.org>
@Yhg1s

Yhg1s commented Dec 2, 2024

Copy link
Copy Markdown
Member

@vstinner this backport is broken because of a missing import of _testcapi, which exposes a different problem in the upstream change (where _testcapi is imported at the top level when it's available): the tests aren't skipped if _testcapi is None. Would you mind fixing that in main?

@vstinner

vstinner commented Dec 2, 2024

Copy link
Copy Markdown
Member

@vstinner this backport is broken because of a missing import of _testcapi, which exposes a different problem in the upstream change (where _testcapi is imported at the top level when it's available): the tests aren't skipped if _testcapi is None. Would you mind fixing that in main?

Alright, I wrote #127517 to fix the test in main.

@vstinner

vstinner commented Dec 2, 2024

Copy link
Copy Markdown
Member

I included my test_socket fix #127517 in this backport.

@vstinner

vstinner commented Dec 3, 2024

Copy link
Copy Markdown
Member

I included my test_socket fix #127517 in this backport.

Oh, I didn't notice that test_socket is very different in 3.12, it doesn't import _testcapi at the module level. I wrote the test differently to make it specific to CPython.

@vstinner vstinner merged commit b49e902 into python:3.12 Dec 3, 2024
@miss-islington miss-islington deleted the backport-b3687ad-3.12 branch January 2, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants