censor/Censor
1
37
Fork
You've already forked Censor
3

bug: opening of some files fails with various errors #163

Open
opened 2026年03月19日 23:38:55 +01:00 by mahlzahn · 0 comments

Description

(削除) Applying redactions for 99d7576e1e/tests/document_test.py (L279-282) fails likely due to empty pages. (削除ここまで)

samples_pypdf

# TODO: support documents with unreadable meta data
if '017-unreadable-meta-data' in root:
continue

samples_qpdf

# TODO: empty file?
if file in [
'append-xref-loop.pdf',
'bad-direct-root.pdf',
'bad11.pdf',
'bad40.pdf',
'c-empty.pdf',
'empty.pdf',
'enc-XI-R6,V5,U=view,O=master.pdf',
'enc-XI-R6,V5,U=view,attachments,cleartext-metadata.pdf',
'enc-XI-R6,V5,U=wwwww,O=wwwww.pdf',
'enc-XI-long-password.pdf',
'filter-on-write-out.pdf',
'filter-on-write.pdf',
'fuzz-16214.pdf',
'indirect-r-arg.pdf',
'inspect.pdf',
'issue-100.pdf',
'issue-101.pdf',
'issue-119.pdf',
'issue-120.pdf',
'issue-141a.pdf',
'issue-143.pdf',
'issue-146.pdf',
'issue-147.pdf',
'issue-148.pdf',
'issue-150.pdf',
'issue-335a.pdf',
'issue-99b.pdf',
'many-nulls.pdf',
'object-stream-self-ref.pdf',
'pages-is-page.pdf',
]:
continue
# TODO: yet another error?
# mupdf.FzErrorSyntax: code=8: invalid key in dict
if file in [
'issue-99.pdf',
]:
continue
# TODO: yet another error?
# mupdf.FzErrorSyntax: code=8: syntax error in object
if file in [
'eof-reading-token.pdf',
'issue-117.pdf',
]:
continue

samples_pikepdf

Lines 145 to 153 in 96bd89f
# MuPDF error: syntax error: invalid key in dict
# syntax error: syntax error in object (94 0 R)
# syntax error: expected object number
# format error: Repair failed already - not trying again
# mupdf.FzErrorSyntax: code=8: invalid key in dict
if file in [
'378014596.pdf',
]:
continue

samples_poppler

Lines 266 to 269 in 96bd89f
if file in [
'mask.pdf',
]:
continue

Impact

(削除) Seems rarely to happen (2 of almost 1,000 PDF sample files) and user is warned about, but may loose redactions of other pages. Thus, it should lead to a warning instead of failure of saving. Check ... (削除ここまで)

Edit: Since !169 (tests fixed in !171), the concerning documents are failing to open (with a warning message) and thus, I am not concerned about the impact.

## Description ~Applying redactions for https://codeberg.org/censor/Censor/src/commit/99d7576e1e57903d9e45a65d85364cf2a73c9af9/tests/document_test.py#L279-282 fails likely due to empty pages.~ #### `samples_pypdf` https://codeberg.org/censor/Censor/src/commit/96bd89f19a24bb2b9d6c8ec89e6546fd730f271f/tests/document_samples.py#L34-L36 #### `samples_qpdf` https://codeberg.org/censor/Censor/src/commit/96bd89f19a24bb2b9d6c8ec89e6546fd730f271f/tests/document_samples.py#L78-L124 #### `samples_pikepdf` https://codeberg.org/censor/Censor/src/commit/96bd89f19a24bb2b9d6c8ec89e6546fd730f271f/tests/document_samples.py#L145-L153 #### `samples_poppler` https://codeberg.org/censor/Censor/src/commit/96bd89f19a24bb2b9d6c8ec89e6546fd730f271f/tests/document_samples.py#L266-L269 ## Impact ~Seems rarely to happen (2 of almost 1,000 PDF sample files) and user is warned about, but may loose redactions of other pages. Thus, it should lead to a warning instead of failure of saving. Check ...~ Edit: Since !169 (tests fixed in !171), the concerning documents are failing to open (with a warning message) and thus, I am not concerned about the impact.
mahlzahn changed title from (削除) bug: saving of redactions fail with unknown error (削除ここまで) to bug: opening of some files fails with various errors 2026年03月25日 10:16:52 +01:00
Sign in to join this conversation.
No Branch/Tag specified
main
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
censor/Censor#163
Reference in a new issue
censor/Censor
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?