Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests hanging on MacOS #13

Open
bretello opened this issue Dec 25, 2024 · 0 comments
Open

tests hanging on MacOS #13

bretello opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bretello
Copy link
Owner

Tests are currently hanging on MacOS possibly due to termios. Here's a minimal example to reproduce the issue:

import os
import termios
import time
from threading import Thread

device_fd, tty_fd = os.openpty()


def loop():
    print("starting read loop")
    while True:
        print(".", end="")
        data = os.read(device_fd, 1)
        print(f"got {data=}")  # <--- never gets here
        time.sleep(0.1)


thread = Thread(target=loop, daemon=True)
thread.start()

os.write(tty_fd, b"123")
termios.tcdrain(tty_fd)  # <--- gets stuck here
time.sleep(3)  # allow thread to read all data

For some more context see 9330c33 and python/cpython#97001

@bretello bretello added bug Something isn't working help wanted Extra attention is needed labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant