From d1a6bd7052030c3673a803c2a7a9289cc9441165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 15 Jul 2019 11:08:44 +0300 Subject: [PATCH] Close sys.stdin after we create the unbuffered version --- ethermess.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethermess.py b/ethermess.py index e908f0f..3a3a9c0 100644 --- a/ethermess.py +++ b/ethermess.py @@ -193,8 +193,10 @@ def handle_message(mac, message): print('<%s> %s' % (nick, ascii(line))) def eventloop(proc): - # Create unbuffered version of stdin + # Create unbuffered version of stdin and close the old one as we + # won't need it anymore unbuf_stdin = open(sys.stdin.buffer.fileno(), 'rb', buffering = 0) + sys.stdin.close() # Set up a poll for inputs (but do output blockingly) poll = select.poll()