From 7b8858678fe60a046950d7042905faf20468964c Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 25 May 2025 07:30:13 -0700 Subject: [PATCH] ignore utf-8 decoding errors --- kindlecomicconverter/KCC_gui.py | 2 +- kindlecomicconverter/comic2ebook.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index e2b255b..ebab86f 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -880,7 +880,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow): except Exception: pass try: - versionCheck = subprocess_run(['kindlegen', '-locale', 'en'], stdout=PIPE, stderr=STDOUT, encoding='UTF-8', check=True) + versionCheck = subprocess_run(['kindlegen', '-locale', 'en'], stdout=PIPE, stderr=STDOUT, encoding='UTF-8', errors='ignore', check=True) self.kindleGen = True for line in versionCheck.stdout.splitlines(): if 'Amazon kindlegen' in line: diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index ff430a2..c70450d 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1350,7 +1350,7 @@ def makeMOBIWorker(item): try: if os.path.getsize(item) < 629145600: output = subprocess_run(['kindlegen', '-dont_append_source', '-locale', 'en', item], - stdout=PIPE, stderr=STDOUT, encoding='UTF-8', check=True) + stdout=PIPE, stderr=STDOUT, encoding='UTF-8', errors='ignore', check=True) else: # ERROR: EPUB too big kindlegenErrorCode = 23026