Fix sys.setdefaultencoding in Python 3

This does away with the setdefaultencoding hack in Python 3
This commit is contained in:
Labrys of Knossos 2018-12-15 14:43:42 -05:00
commit 02ae99b117

View file

@ -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')
MYAPP = None
import six
from six.moves import reload_module
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'):
SYS_ENCODING = 'UTF-8'
if six.PY2:
if not hasattr(sys, "setdefaultencoding"):
reload_module(sys)