From b1e75528e5928acd3e5c51b498783716413cae01 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 9 Nov 2025 15:42:51 +0100 Subject: [PATCH] fixing CI issues --- .gitattributes | 2 ++ dreader/managers/document.py | 3 +++ tests/data/library-epub/pg5200-images-3.epub | Bin 122049 -> 122381 bytes tests/test_settings_overlay.py | 7 +++++++ 4 files changed, 12 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2efe7e9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Mark EPUB files as binary to prevent any text transformations +*.epub binary diff --git a/dreader/managers/document.py b/dreader/managers/document.py index bcf66be..3c75067 100644 --- a/dreader/managers/document.py +++ b/dreader/managers/document.py @@ -70,6 +70,9 @@ class DocumentManager: except Exception as e: print(f"Error loading EPUB: {e}") + import traceback + print(f"Full traceback:") + traceback.print_exc() return False def load_html(self, html_string: str, title: str = "HTML Document", diff --git a/tests/data/library-epub/pg5200-images-3.epub b/tests/data/library-epub/pg5200-images-3.epub index 09cd37869ec849efa1e7865c104265d5badfcfd5..8670db984eda26ef5631eae33abaa586aa12a09b 100644 GIT binary patch delta 633 zcmX@Olf8EjJ4b*wGm8j=7{^2o3nnp+=^Jk_icO3-3uJCqXS99?qEp@|c7?H+r5@xC1`ZAe?b^)f9|skdA7Nl%cmTw5KW zn3I`Qlp3FupP!wZSd?9?S5i@;+UJZ00>Qj76jQ>f!>NgI~ zSNys}bf(OaX{&={E!u*Qw-uZ-JhR4#`|$4{t68`^c9@;2XWA(n6MTqEV5j%->Cc!> zeKn|!zcs6RW^Eknujd8H67w>*MrKUiSG0$-d{;!7l+D%5Ij{frPQAv;BYphBUV*aq z{)dIT=D3E$96fQKSLwC$M3s830B=Sn5oS{O-4{C zPw%+NXbz%*Q30YSJA4tFE^rH?Hsls#1W0Zjl;*e%;U_`qJ+~RHLGnLuGg^XZlRJzK yKziC0MzQHVcNi5DAg;g_6Trv-g9gUJ8;k_vCBU1N4Ww8A2-{c~7z%GP0(k(LLE3Zx delta 299 zcmeC(!+vllJ4b*wGm8iV1H(iP3nm7J=^Jk{icO3-3uJCqXS99?qEp@|c7?H+g@chvgc;D4zGO@N{xw>W|5uQwTkLA2K`MvxuTJ8m(W zgJ_^bK=fpXFJjXLZbQ_D+-8gb$*qIZ9Csl6Bq+V-4x=?l{^uP=OAu{xm(c-8PrJe> cHofOAqoN2a8_)?1{6J{M!oW~?gAvFB0HDH9WdHyG diff --git a/tests/test_settings_overlay.py b/tests/test_settings_overlay.py index d5e8023..9786f0f 100644 --- a/tests/test_settings_overlay.py +++ b/tests/test_settings_overlay.py @@ -48,6 +48,13 @@ class TestSettingsOverlay(unittest.TestCase): # Test if it's a valid ZIP if test_epub.exists(): + # Check file magic bytes + with open(test_epub, 'rb') as f: + first_bytes = f.read(10) + print(f"First 10 bytes (hex): {first_bytes.hex()}") + print(f"First 10 bytes (ascii): {first_bytes[:4]}") + print(f"Is PK header: {first_bytes[:2] == b'PK'}") + try: with zipfile.ZipFile(test_epub, 'r') as zf: print(f"Valid ZIP: True")