Skip to content

Commit

Permalink
fix 1088: correct BooleanObject compare
Browse files Browse the repository at this point in the history
  • Loading branch information
exiledkingcc committed Jul 25, 2022
1 parent 0b27287 commit 8661b1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion PyPDF2/_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def compute_key(
u_hash.update(o_entry)
u_hash.update(struct.pack("<I", P))
u_hash.update(id1_entry)
if rev >= 3 and not metadata_encrypted:
if rev >= 4 and metadata_encrypted == False:
u_hash.update(b"\xff\xff\xff\xff")
u_hash_digest = u_hash.digest()
length = key_size // 8
Expand Down
1 change: 0 additions & 1 deletion tests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ def test_text_extraction_issue_1091():
page.extract_text()


@pytest.mark.xfail(reason="#1088")
def test_empyt_password_1088():
url = "https://corpora.tika.apache.org/base/docs/govdocs1/941/941536.pdf"
name = "tika-941536.pdf"
Expand Down

0 comments on commit 8661b1a

Please sign in to comment.