From 6dce09d6a6d76ea872b56883e9147ec583af81a1 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 12 Jun 2025 13:07:36 +0100 Subject: [PATCH 1/3] scripts/test.py: improve --cibw-release-2. Need to restrict linuxaarch testing to python-3.9 and python-3.13, otherwise it times-out on github. --- scripts/test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/test.py b/scripts/test.py index a0529e62b..42dab0a22 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -346,6 +346,9 @@ def main(argv): elif arg == '--cibw-release-2': env_extra['CIBW_ARCHS_LINUX'] = 'aarch64' + # Testing only first and last python versions because otherwise + # Github times out after 6h. + env_extra['CIBW_BUILD'] = 'cp39* cp313*' os_names = ['linux'] elif arg == '--cibw-archs-linux': From 5cec8f1b78a54331728c7faeb052bb02089b6299 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Fri, 20 Jun 2025 10:13:32 +0100 Subject: [PATCH 2/3] tests/: added test_4564. Checks handling of strings with embedded zero characters. --- tests/resources/test_4564.pdf | Bin 0 -> 903 bytes tests/test_general.py | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/resources/test_4564.pdf diff --git a/tests/resources/test_4564.pdf b/tests/resources/test_4564.pdf new file mode 100644 index 0000000000000000000000000000000000000000..486a100f99e17ebfa72deb94a0fcb6c7b7b7b443 GIT binary patch literal 903 zcmb_a!D`$v5WVXwbXiCasYjAEw!s)|*@jR`7q|4X?7_`ygG;cA*IV5FSNj3^vW}c) z#Jh-X9)CanVN7t~?&~*}rorc*-)&&pv3+p&!M44(CoU=5 zWEr#l!IPLjFWECIFz(!sTmT5BAWtg`0LjS)FJehjJe@ zZfr-(A!zK$orgPW%S$%Y;$Z2&>mK!sv>9wWy5Y*Sz3X|`+~nmKZj_RmbMoOj*beS+ zzO%#CG)>ow_NKue8E|B9Ssb-injiTE6UgT*?_V&aZv0wcLeOQ`7%8nWDHnQd9NO-| z4t_45x?h%KaN8dp_m^wP5=VZ|+uL%N0!A@PNQ}y3nTNv29JNG45sWNUmWo0p65-01WA)J+%j@0Vn_k z(2DZr>8yw+D*#25g=QSOmp!(9*y*h{PLst&vt56#z~bJ jQHL7C$VgS23Uz{cRF$QY*`8jO{lUq{SH4Cv`RD6jy71z} literal 0 HcmV?d00001 diff --git a/tests/test_general.py b/tests/test_general.py index 0c1620a43..1288c2279 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -1894,3 +1894,16 @@ def test_4533(): with pymupdf.open(path) as document: print(f'Have opened {path=}.', flush=1) print(f'{len(document)=}', flush=1) + + +def test_4564(): + path = os.path.normpath(f'{__file__}/../../tests/resources/test_4564.pdf') + print() + with pymupdf.open(path) as document: + for key in sorted(document.metadata.keys()): + value = document.metadata[key] + print(f'{key}: {value!r}') + if pymupdf.mupdf_version_tuple >= (1, 27): + assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\x00' + else: + assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\udcc0\udc80' From f47016957f954ba82ad1c462ae80c4ab598a05b3 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Mon, 23 Jun 2025 11:09:32 +0100 Subject: [PATCH 3/3] tests/test_font.py: fix spurious breakage caused by external test files changing. The (large) test files are now downloaded from the original github issue page. --- tests/test_font.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_font.py b/tests/test_font.py index 58396984c..4d5958cd9 100644 --- a/tests/test_font.py +++ b/tests/test_font.py @@ -233,8 +233,8 @@ def test_3887(): def test_4457(): print() files = ( - ('https://arxiv.org/pdf/2504.13180', 'test_4457_a.pdf', None, 4), - ('https://arxiv.org/pdf/2504.13181', 'test_4457_b.pdf', None, 9), + ('https://github.com/user-attachments/files/20862923/test_4457_a.pdf', 'test_4457_a.pdf', None, 4), + ('https://github.com/user-attachments/files/20862922/test_4457_b.pdf', 'test_4457_b.pdf', None, 9), ) for url, name, size, rms_after_max in files: path = util.download(url, name, size)