Andrei Kulakov <andrei....@gmail.com> added the comment:

I've looked into this and the hang happens on this line:

https://github.com/python/cpython/blob/de3db1448b1b983eeb9f4498d07e3d2f1fb6d29d/Lib/test/test_builtin.py#L2030

So the issue is that on the second run, there's nothing to read on that fd. 
I've tried using os.stat to check if there's data on the fd, but it returned 0 
data in both 1st and 2nd runs.

However, if a small sleep is added before running os.stat, it does return size 
of data on 1st run and returns 0 on 2nd run, meaning it's possible to avoid the 
hang and error out instead (is that an improvement?)

This is on MacOS 11.4 Big Sur by the way.

This is my test debug branch:

https://github.com/python/cpython/compare/main...akulakov:Test-check_input_tty-FIX?expand=1

----------
nosy: +andrei.avk, kj

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44887>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to