Fix Encoding issues for python2

This commit is contained in:
Ozzieisaacs
2019-06-23 21:11:45 +02:00
parent 32af660f86
commit 572b5427c7
13 changed files with 5244 additions and 1119 deletions
+2
View File
@@ -326,6 +326,8 @@ class WorkerThread(threading.Thread):
nextline = p.stdout.readline()
if os.name == 'nt' and sys.version_info < (3, 0):
nextline = nextline.decode('windows-1252')
elif os.name == 'posix' and sys.version_info < (3, 0):
nextline = nextline.decode('utf-8')
log.debug(nextline.strip('\r\n'))
# parse progress string from calibre-converter
progress = re.search("(\d+)%\s.*", nextline)