Expose termios baud rate constants and IBSHIFT on Linux - #16474
Merged
Merged
Conversation
When CPython is built against glibc 2.42 or newer, the termios module on Linux exposes B7200, B14400, B28800, B76800 (Python 3.13+) and IBSHIFT, but the stub only declared them on other platforms. - Declare the B* constants for Python 3.13+ on all non-Windows platforms - Declare IBSHIFT on all non-macOS platforms, including Linux - Allowlist them as optional for stubtest, since the GitHub Actions runners build against an older glibc that lacks the macros
anistark
force-pushed
the
fix-termios-glibc-baud
branch
from
October 4, 2026 11:56
4ef1ea2 to
eeb5fab
Compare
This comment has been minimized.
This comment has been minimized.
srittau
requested changes
Oct 5, 2026
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When CPython is built against glibc 2.42 or newer,
termioson Linux exposesB7200,B14400,B28800,B76800(Python 3.13+) andIBSHIFT, but the stub only declares them on other platforms. glibc 2.42 added arbitrary baud rate support, which defines these macros, andtermios.cexports them whenever they are defined (IBSHIFT).Declare the
B*constants for 3.13+ on all non-Windows platforms andIBSHIFTon all non-macOS platforms, with optional stubtest allowlist entries because the GitHub Actions runners build against an older glibc.Prepared with Claude Code.