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

bug: not possible to redact annotations in some files #137

Closed
opened 2026年03月12日 16:46:59 +01:00 by mahlzahn · 1 comment

Description

!136 implemented redaction of annotations, but it fails on the sample PDF file from https://github.com/py-pdf/sample-files/tree/main/024-annotations because of an AttributeError:


/usr/lib/python3.14/site-packages/pymupdf/__init__.py in ?(self, name, xref)
 10219 if xref == 0:
 10220 annot = JM_get_annot_by_name(page, name)
 10221 else:
 10222 annot = JM_get_annot_by_xref(page, xref)
> 10223 if annot.m_internal:
 10224 return Annot(annot)
AttributeError: 'NoneType' object has no attribute 'm_internal'

https://github.com/pymupdf/PyMuPDF/issues/4928

## Description !136 implemented redaction of annotations, but it fails on the sample PDF file from https://github.com/py-pdf/sample-files/tree/main/024-annotations because of an `AttributeError`: ```py /usr/lib/python3.14/site-packages/pymupdf/__init__.py in ?(self, name, xref) 10219 if xref == 0: 10220 annot = JM_get_annot_by_name(page, name) 10221 else: 10222 annot = JM_get_annot_by_xref(page, xref) > 10223 if annot.m_internal: 10224 return Annot(annot) AttributeError: 'NoneType' object has no attribute 'm_internal' ``` ## Related upstream issue https://github.com/pymupdf/PyMuPDF/issues/4928
mahlzahn changed title from (削除) bug: not possible to redact some files with annotations (削除ここまで) to bug: not possible to redact annotations in some files 2026年03月12日 17:16:09 +01:00
Author
Owner
Copy link

With v0.5.0, the impact of this issue is low, because:

  1. The user is warned about it with an alert dialog
  2. On pages, where annotation redaction fails, all annotations are removed during the final sanitization step when the document is saved.
With [v0.5.0](https://codeberg.org/censor/Censor/releases/tag/v0.5.0), the impact of this issue is low, because: 1. The user is warned about it with an alert dialog 2. On pages, where annotation redaction fails, all annotations are removed during the final sanitization step when the document is saved.
mahlzahn added this to the v0.7.1 milestone 2026年04月28日 16:54:39 +02: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#137
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?