mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Merge pull request #1423 from clinton-hall/py3/encoding
Fix encoding for Python 3
This commit is contained in:
commit
aa769627bd
2 changed files with 17 additions and 14 deletions
|
@ -31,6 +31,7 @@ CONFIG_TV_FILE = os.path.join(PROGRAM_DIR, 'autoProcessTv.cfg')
|
||||||
TEST_FILE = os.path.join(os.path.join(PROGRAM_DIR, 'tests'), 'test.mp4')
|
TEST_FILE = os.path.join(os.path.join(PROGRAM_DIR, 'tests'), 'test.mp4')
|
||||||
MYAPP = None
|
MYAPP = None
|
||||||
|
|
||||||
|
import six
|
||||||
from six.moves import reload_module
|
from six.moves import reload_module
|
||||||
|
|
||||||
from core.autoProcess.autoProcessComics import autoProcessComics
|
from core.autoProcess.autoProcessComics import autoProcessComics
|
||||||
|
@ -269,6 +270,7 @@ def initialize(section=None):
|
||||||
if not SYS_ENCODING or SYS_ENCODING in ('ANSI_X3.4-1968', 'US-ASCII', 'ASCII'):
|
if not SYS_ENCODING or SYS_ENCODING in ('ANSI_X3.4-1968', 'US-ASCII', 'ASCII'):
|
||||||
SYS_ENCODING = 'UTF-8'
|
SYS_ENCODING = 'UTF-8'
|
||||||
|
|
||||||
|
if six.PY2:
|
||||||
if not hasattr(sys, "setdefaultencoding"):
|
if not hasattr(sys, "setdefaultencoding"):
|
||||||
reload_module(sys)
|
reload_module(sys)
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@ class GitUpdateManager(UpdateManager):
|
||||||
|
|
||||||
if output:
|
if output:
|
||||||
output = output.strip()
|
output = output.strip()
|
||||||
|
output = output.decode('utf-8')
|
||||||
if core.LOG_GIT:
|
if core.LOG_GIT:
|
||||||
logger.log(u"git output: {output}".format(output=output), logger.DEBUG)
|
logger.log(u"git output: {output}".format(output=output), logger.DEBUG)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue