diff --git a/src/calibre/utils/windows/winspeech.py b/src/calibre/utils/windows/winspeech.py index 9e2635a612..ec43e02616 100644 --- a/src/calibre/utils/windows/winspeech.py +++ b/src/calibre/utils/windows/winspeech.py @@ -302,9 +302,9 @@ class WinSpeech: def _get_messages(self, worker, queue): try: for line in worker.stdout: - queue.put(line.decode('utf-8')) + queue.put(line.decode('utf-8', 'replace')) except OSError as e: - line = ('0 error ' + json.dumps({"msg": "Failed to read from worker", "error": str(e), "file": "winspeech.py", "line": 0})) + line = '0 error ' + json.dumps({"msg": "Failed to read from worker", "error": str(e), "file": "winspeech.py", "line": 0}) queue.put(line)