summaryrefslogtreecommitdiffhomepage
path: root/bazarr.py
diff options
context:
space:
mode:
authorSmaarn <[email protected]>2020-02-09 13:23:56 +0100
committerSmaarn <[email protected]>2020-02-09 13:23:56 +0100
commit6c0d2926b8679874ae3e4535ff40ca5037f26a87 (patch)
treed90bcd336a74990b1b297284a513442b551adad6 /bazarr.py
parent7c061874fb52420b3dc39696d296a338fe4c3f88 (diff)
downloadbazarr-6c0d2926b8679874ae3e4535ff40ca5037f26a87.tar.gz
bazarr-6c0d2926b8679874ae3e4535ff40ca5037f26a87.zip
change: log redirection mechanism
Rely on native output and error stream printing. Blocked input reading
Diffstat (limited to 'bazarr.py')
-rw-r--r--bazarr.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/bazarr.py b/bazarr.py
index f9335a3bc..be643ec23 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -116,21 +116,12 @@ class DaemonStatus(ProcessRegistry):
def start_bazarr(process_registry=ProcessRegistry()):
script = [sys.executable, "-u", os.path.normcase(os.path.join(dir_name, 'bazarr', 'main.py'))] + sys.argv[1:]
- ep = subprocess.Popen(script, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)
- process_registry.register(ep)
print("Bazarr starting...")
+ ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL)
+ process_registry.register(ep)
try:
- while True:
- line = ep.stdout.readline()
- if line == '' or not line:
- # Process ended so let's unregister it
- process_registry.unregister(ep)
- break
- if PY3:
- sys.stdout.buffer.write(line)
- else:
- sys.stdout.write(line)
- sys.stdout.flush()
+ ep.wait()
+ process_registry.unregister(ep)
except KeyboardInterrupt:
pass