make daemon mode runnable
The error is fixed by making stderr binary mode.
This commit is contained in:
parent
75d2b36927
commit
218cc9723c
|
@ -325,7 +325,7 @@ class Main(object):
|
||||||
if not sys.platform.startswith('win'):
|
if not sys.platform.startswith('win'):
|
||||||
si = open(os.devnull, 'r')
|
si = open(os.devnull, 'r')
|
||||||
so = open(os.devnull, 'a+')
|
so = open(os.devnull, 'a+')
|
||||||
se = open(os.devnull, 'a+', 0)
|
se = open(os.devnull, 'ab+', 0)
|
||||||
os.dup2(si.fileno(), sys.stdin.fileno())
|
os.dup2(si.fileno(), sys.stdin.fileno())
|
||||||
os.dup2(so.fileno(), sys.stdout.fileno())
|
os.dup2(so.fileno(), sys.stdout.fileno())
|
||||||
os.dup2(se.fileno(), sys.stderr.fileno())
|
os.dup2(se.fileno(), sys.stderr.fileno())
|
||||||
|
|
Reference in New Issue
Block a user