Skip to content

test_ioctl failing on MacOS #132843

Closed
@smontanaro

Description

@smontanaro

Bug report

Bug description:

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 .

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions