From 99b1e003cbd6db28990ea45ec206a1266bc61747 Mon Sep 17 00:00:00 2001 From: enkore Date: Thu, 21 Feb 2013 14:05:11 +0100 Subject: [PATCH] Fixed crash if used with normal pipe If one wants to run i3status as a subprocess of i3pystatus, do it like this: import subprocess import io ... process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE) stdin = io.TextIOWrapper(process.stdout) status = I3statusHandler(stdin) --- i3pystatus/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3pystatus/__init__.py b/i3pystatus/__init__.py index 485de11..effd7a3 100644 --- a/i3pystatus/__init__.py +++ b/i3pystatus/__init__.py @@ -60,7 +60,7 @@ class IOHandler: Raises EOFError if the end of stream has been reached""" try: - line = self.inp.readline().decode("utf-8").strip() + line = self.inp.readline().strip() except KeyboardInterrupt: raise EOFError()