From b83e6db28bf9aa9f2b2180a93ca6c1703185159d Mon Sep 17 00:00:00 2001 From: Denis Trofimov Date: May 28 2017 14:03:48 +0000 Subject: [PATCH 1/3] Closes #5 DaemonRunner.py fails on python 3.x systems (unbuffered text i/o). --- diff --git a/daemon/runner.py b/daemon/runner.py index 81dc2b3..f4ecaf3 100644 --- a/daemon/runner.py +++ b/daemon/runner.py @@ -120,8 +120,13 @@ class DaemonRunner: self.daemon_context = DaemonContext() self.daemon_context.stdin = open(app.stdin_path, 'rt') self.daemon_context.stdout = open(app.stdout_path, 'w+t') - self.daemon_context.stderr = open( + try: + self.daemon_context.stderr = open( app.stderr_path, 'w+t', buffering=0) + except ValueError: + # Python 3 can't have unbuffered text I/O + self.daemon_context.stderr = open( + app.stderr_path, 'w+t', buffering=1) self.pidfile = None if app.pidfile_path is not None: From a33e3dc44c7b83efa24ed99bca0589a29456fbc1 Mon Sep 17 00:00:00 2001 From: Denis Trofimov Date: Jun 01 2017 19:49:13 +0000 Subject: [PATCH 2/3] Closes #5 DaemonRunner.py fails on python 3.x systems (unbuffered text i/o). --- diff --git a/daemon/runner.py b/daemon/runner.py index 81dc2b3..c11a1e6 100644 --- a/daemon/runner.py +++ b/daemon/runner.py @@ -120,8 +120,7 @@ class DaemonRunner: self.daemon_context = DaemonContext() self.daemon_context.stdin = open(app.stdin_path, 'rt') self.daemon_context.stdout = open(app.stdout_path, 'w+t') - self.daemon_context.stderr = open( - app.stderr_path, 'w+t', buffering=0) + self.daemon_context.stderr = open(app.stderr_path, 'w+t') self.pidfile = None if app.pidfile_path is not None: