Skip to content
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

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

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

miss-islington
Copy link
Contributor

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

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
Copy link
Member

Yhg1s commented Dec 2, 2024

@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
Copy link
Member

vstinner commented Dec 2, 2024

@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
Copy link
Member

vstinner commented Dec 2, 2024

I included my test_socket fix #127517 in this backport.

@vstinner
Copy link
Member

vstinner commented Dec 3, 2024

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
27 checks passed
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