diff options
author | Louis Vézina <[email protected]> | 2019-12-06 22:40:40 -0500 |
---|---|---|
committer | Louis Vézina <[email protected]> | 2019-12-06 22:40:40 -0500 |
commit | 1eb174d9efbe151a59322524f596ac95d1f64dfa (patch) | |
tree | bfe98d6a6299156d100f81ed0b4ddcf6750d2443 | |
parent | e6cb1b1a8fcbc078f63c1289fed41c0f42425ce3 (diff) | |
download | bazarr-1eb174d9efbe151a59322524f596ac95d1f64dfa.tar.gz bazarr-1eb174d9efbe151a59322524f596ac95d1f64dfa.zip |
Fix for restarting since Python 3.
-rw-r--r-- | bazarr.py | 5 | ||||
-rw-r--r-- | bazarr/main.py | 2 | ||||
-rw-r--r-- | libs/bottle.py | 6 |
3 files changed, 10 insertions, 3 deletions
@@ -45,7 +45,10 @@ def start_bazarr(): ep = sp.Popen(script, stdout=sp.PIPE, stderr=sp.STDOUT, stdin=sp.PIPE) print("Bazarr starting...") try: - for line in iter(ep.stdout.readline, ''): + while True: + line = ep.stdout.readline() + if line == '' or not line: + break if PY3: sys.stdout.buffer.write(line) else: diff --git a/bazarr/main.py b/bazarr/main.py index 85d19c7cf..88b0d89c0 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -2251,7 +2251,7 @@ def api_help(): # Mute DeprecationWarning -warnings.simplefilter("ignore", DeprecationWarning) +warnings.simplefilter("ignore", (DeprecationWarning, BrokenPipeError)) server = CherryPyWSGIServer((str(settings.general.ip), (int(args.port) if args.port else int(settings.general.port))), app) try: logging.info('BAZARR is started and waiting for request on http://' + str(settings.general.ip) + ':' + (str( diff --git a/libs/bottle.py b/libs/bottle.py index 3a51b3813..81a39d4ad 100644 --- a/libs/bottle.py +++ b/libs/bottle.py @@ -41,7 +41,11 @@ import base64, cgi, email.utils, functools, hmac, imp, itertools, mimetypes,\ from datetime import date as datedate, datetime, timedelta from tempfile import TemporaryFile from traceback import format_exc, print_exc -from inspect import getargspec +from six import PY2 +if PY2: + from inspect import getargspec +else: + from inspect import getfullargspec as getargspec from unicodedata import normalize |