From 0bd55a27f2f14dd434c828f4a061f366b39dda92 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 13 Sep 2012 09:48:35 +0200 Subject: Fix TBs when the system is not in utf-8 by default (force every file opening to be with the utf-8 encoding) --- src/fifo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fifo.py') diff --git a/src/fifo.py b/src/fifo.py index 8306e24b..7db4b160 100644 --- a/src/fifo.py +++ b/src/fifo.py @@ -32,7 +32,7 @@ class OpenTrick(threading.Thread): self.path = path def run(self): - open(self.path, 'r').close() + open(self.path, 'r', encoding='utf-8').close() class Fifo(object): @@ -49,7 +49,7 @@ class Fifo(object): self.trick = OpenTrick(path) # that thread will wait until we open it for writing self.trick.start() - self.fd = open(path, mode) + self.fd = open(path, mode, encoding='utf-8') def write(self, data): """ -- cgit v1.2.3