diff --git a/daemoncmd.py b/daemoncmd.py index e2addcc..a540d09 100755 --- a/daemoncmd.py +++ b/daemoncmd.py @@ -217,7 +217,7 @@ def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # streams. si = open(stdin, 'r') so = open(stdout, 'a+') - se = open(stderr, 'a+', 0) + se = open(stderr, 'a+b', 0) # hack and bug: when sys.stdin.close() has already been called, # os.dup2 throws an exception: ValueError: I/O operation on closed file @@ -271,7 +271,7 @@ def running(pid): return False try: os.kill(pid, signal.SIG_DFL) - except OSError, exc: + except OSError as exc: if exc.errno == errno.ESRCH: # The specified PID does not exist return False