Force a few error messages to unicode

This commit is contained in:
Kovid Goyal 2020-06-25 14:02:12 +05:30
parent 36288d8343
commit ea7637bf60
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ class Saver(QObject):
except Failure as err:
error_dialog(self.pd, _('Critical failure'), _(
'Could not save books to disk, click "Show details" for more information'),
det_msg=unicode_type(err.failure_message) + '\n' + unicode_type(err.details), show=True)
det_msg=force_unicode(err.failure_message) + '\n' + force_unicode(err.details), show=True)
self.pd.canceled = True
self.do_one_signal.emit()

View File

@ -18,7 +18,7 @@ from math import ceil
from multiprocessing.connection import Listener, arbitrary_address
from threading import RLock, Thread
from calibre import detect_ncpus as cpu_count
from calibre import detect_ncpus as cpu_count, force_unicode
from calibre.constants import DEBUG, islinux, iswindows, ispy3
from calibre.ptempfile import base_dir
from calibre.utils.ipc import eintr_retry_call
@ -228,7 +228,7 @@ class Server(Thread):
}
cw = self.do_launch(env, gui, redirect_output, rfile, job_name=job_name)
if isinstance(cw, string_or_bytes):
raise CriticalError('Failed to launch worker process:\n'+cw)
raise CriticalError('Failed to launch worker process:\n'+force_unicode(cw))
if DEBUG:
print('Worker Launch took:', time.time() - start)
return cw