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

Unprotected file raising FileFormatError instead of returning False when checked with is_encrypted() #74

Closed
it-sanwa-ei opened this issue Jan 26, 2023 · 1 comment
Labels

Comments

@it-sanwa-ei
Copy link

import msoffcrypto

protected = './protected.xlsx'
unprotected = './unprotected.xlsx'
password = '12345'

file = open(protected, 'rb')
ms_file = msoffcrypto.OfficeFile(file).is_encrypted()
print(ms_file)

This return

True

, but when I try

file = open(unprotected, 'rb')
ms_file = msoffcrypto.OfficeFile(file).is_encrypted()
print(ms_file)

This give me

FileFormatError: Unencrypted document or unsupported file format

instead of False

@nolze
Copy link
Owner

nolze commented Jul 17, 2023

Fixed in d0383c8 and released v5.1.0. Thank you for reporting!

@nolze nolze closed this as completed Jul 17, 2023
@nolze nolze added bug and removed just a moment labels Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants