Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Simplify file identifiers generation #2003

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update pypdf/_writer.py
MartinThoma authored Dec 23, 2023
commit f095cdcaa8a73c4b953f393b669c62975ab59acb
5 changes: 2 additions & 3 deletions pypdf/_writer.py
Original file line number Diff line number Diff line change
@@ -1329,9 +1329,8 @@ def encrypt(
if not use_128bit:
alg = EncryptAlgorithm.RC4_40
self.generate_file_identifiers()
self._encryption = Encryption.make(
alg, permissions_flag, cast(ArrayObject, self._ID)[0]
)
assert self._ID
self._encryption = Encryption.make(alg, permissions_flag, self._ID[0])
# in case call `encrypt` again
entry = self._encryption.write_entry(user_password, owner_password)
if self._encrypt_entry: