Pierre <[email protected]> added the comment:
A workaround consists in replacing fd(0) with /dev/tty without modifying
sys.stdin
import os
stdin = os.dup(0)
os.close(0)
tty = os.open("/dev/tty", os.O_RDONLY)
assert tty == 0
import readline
print("input:", input())
print("in:", os.read(stdin, 128))
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue512981>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com