◐ Shell
clean mode source ↗

gh-110014: Remove PY_TIMEOUT_MAX from limited C API by vstinner · Pull Request #110217 · python/cpython

@vstinner vstinner changed the title gh-:110014 Remove PY_TIMEOUT_MAX from limited C API gh-110014: Remove PY_TIMEOUT_MAX from limited C API

Oct 2, 2023
If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX
microseconds, which is around 280.6 years. This case is unlikely and
limiting a timeout to 280.6 years sounds like a reasonable trade-off.

The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request

Sep 2, 2024
)

If the timeout is greater than PY_TIMEOUT_MAX,
PyThread_acquire_lock_timed() uses a timeout of PY_TIMEOUT_MAX
microseconds, which is around 280.6 years. This case is unlikely and
limiting a timeout to 280.6 years sounds like a reasonable trade-off.

The constant PY_TIMEOUT_MAX is not used in PyPI top 5,000 projects.