Minor fixes

This commit is contained in:
Miroslav Štampar 2026-06-22 22:11:16 +02:00
parent bf28b0ae47
commit 87a3a2e51c
13 changed files with 247 additions and 88 deletions

View file

@ -199,4 +199,9 @@ def send_all(p, data):
sent = p.send(data)
if not isinstance(sent, int):
break
if sent == 0:
# Note: POSIX send() returns 0 when the child's stdin pipe is not currently writable;
# back off briefly instead of busy-spinning at 100% CPU until the child drains it
time.sleep(0.01)
continue
data = buffer(data[sent:])