From 3622443631bbb901baaa75552e2021ae0b2798e6 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 19 Apr 2014 06:36:10 +0200 Subject: Keep a file descriptor reading the fifo instead of just opening and closing it should take care of the sigpipe when no one is reading it anymore due to broken connection --- src/fifo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fifo.py b/src/fifo.py index 7db4b160..983b21e4 100644 --- a/src/fifo.py +++ b/src/fifo.py @@ -30,9 +30,10 @@ class OpenTrick(threading.Thread): def __init__(self, path): threading.Thread.__init__(self) self.path = path + self.fd = None def run(self): - open(self.path, 'r', encoding='utf-8').close() + self.fd = open(self.path, 'r', encoding='utf-8') class Fifo(object): -- cgit v1.2.3