You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new test, test_ioctl.test_ioctl_tcflush, fails for me on M1 MacBook Pro (Sequoia 15.4.1) because termios doesn't have a TCFLSH attribute.
% ./python.exe -m test test_ioctl
Using random seed: 2942680825
0:00:00 load avg: 1.77 Run 1 test sequentially in a single process
0:00:00 load avg: 1.77 [1/1] test_ioctl
test test_ioctl failed -- Traceback (most recent call last):
File "/Users/skip/src/python/cpython/Lib/test/test_ioctl.py", line 137, in test_ioctl_tcflush
r = fcntl.ioctl(tty, termios.TCFLSH, termios.TCIFLUSH)
^^^^^^^^^^^^^^
AttributeError: module 'termios' has no attribute 'TCFLSH'. Did you mean: 'CFLUSH'?
0:00:00 load avg: 1.77 [1/1/1] test_ioctl failed (1 error)
== Tests result: FAILURE ==
1 test failed:
test_ioctl
Total duration: 20 ms
Total tests: run=8
Total test files: run=1/1 failed=1
Result: FAILURE
Here's what termios does have which resembles "flush":
>>> [a for a in dir(termios) if "FLUSH" in a or "FLSH" in a]
['CFLUSH', 'FLUSHO', 'NOFLSH', 'TCIFLUSH', 'TCIOFLUSH', 'TCOFLUSH', 'TCSAFLUSH', 'TIOCPKT_FLUSHREAD', 'TIOCPKT_FLUSHWRITE']
I saw no check for TCFLSH in configure, so presume it's expected to be widely available, but I know nothing about this stuff. Pinging @serhiy-storchaka .
The test is passed on CI and builtbots because all these tests are skipped because "/dev/tty" is not available.
I discovered this when worked on #132791. There are some issues with handling tcflush() and tcflow() on BSD/macOS, but the part of that PR which fixes dependency on "/dev/tty" and TCFLSH can be safely merged.
Activity
serhiy-storchaka commentedon Apr 23, 2025
The test is passed on CI and builtbots because all these tests are skipped because "/dev/tty" is not available.
I discovered this when worked on #132791. There are some issues with handling tcflush() and tcflow() on BSD/macOS, but the part of that PR which fixes dependency on "/dev/tty" and TCFLSH can be safely merged.
pythongh-83994, pythongh-132843: Fix and improve test_ioctl
gh-83994, gh-132843: Fix and improve test_ioctl (GH-132848)
[3.13] pythongh-83994, pythongh-132843: Fix and improve test_ioctl (p…
[3.13] gh-83994, gh-132843: Fix and improve test_ioctl (GH-132848) (G…