Open
Description
Bug report
Bug description:
This code terminates with error messages after several loop iterations:
import sys
import os
import select
os.set_blocking(sys.stdin.fileno(), False)
while True:
print('>')
ready = select.select([sys.stdin, ], [], [], 0.0)[0]
print(f'< ready={ready}')
$ python3.11 stdin-nonblocking-bug-report.py
<... skip many iterations ...>
< ready=[]
>
< ready=[]
>
< ready=[]
Traceback (most recent call last):
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
Exception ignored in sys.unraisablehook: <built-in function unraisablehook>
$ echo $?
120
The failure occurs in print(f'< ready={ready}')
.
Python-3.11
FreeBSD 14.1
CPython versions tested on:
3.11
Operating systems tested on:
Other