Skip to content

Add fcntl.F_DUPFD_QUERY on Linux - #16436

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
anistark:fix-fcntl-dupfd-query
Sep 27, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
anistark:fix-fcntl-dupfd-query

Conversation

@anistark

Copy link
Copy Markdown
Contributor

Python 3.14 exposes F_DUPFD_QUERY in the fcntl module on Linux, but the stub does not declare it, so type checkers reject fcntl.fcntl(fd, fcntl.F_DUPFD_QUERY, other_fd). See the fcntl docs ("Changed in version 3.14") and the fcntlmodule.c definition.

Declare the constant for Python 3.14 and later on Linux, with an optional stubtest allowlist entry because CPython only exposes it when built against a glibc that provides the macro, which the GitHub Actions runners currently lack.

Python 3.14 exposes `F_DUPFD_QUERY` in `fcntl` on Linux, but the stub
did not declare it, so type checkers rejected its use.

- Declare it for Python 3.14 and later on Linux
- Allowlist it as optional for stubtest, since the GitHub Actions
  runners build against a glibc that lacks the macro
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra
JelleZijlstra merged commit 3838468 into python:main Sep 27, 2026
88 checks passed
@anistark
anistark deleted the fix-fcntl-dupfd-query branch September 28, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants