Skip to content

Commit ad13d45

Browse files
tests/: added test_4564.
Checks handling of strings with embedded zero characters.
1 parent d887090 commit ad13d45

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/resources/test_4564.pdf

903 Bytes
Binary file not shown.

tests/test_general.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,3 +1894,16 @@ def test_4533():
18941894
with pymupdf.open(path) as document:
18951895
print(f'Have opened {path=}.', flush=1)
18961896
print(f'{len(document)=}', flush=1)
1897+
1898+
1899+
def test_4564():
1900+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4564.pdf')
1901+
print()
1902+
with pymupdf.open(path) as document:
1903+
for key in sorted(document.metadata.keys()):
1904+
value = document.metadata[key]
1905+
print(f'{key}: {value!r}')
1906+
if pymupdf.mupdf_version_tuple >= (1, 27):
1907+
assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\x00'
1908+
else:
1909+
assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\udcc0\udc80'

0 commit comments

Comments
 (0)