Additional error output for failed encryption

This commit is contained in:
Moshe Kaplan 2016-11-16 09:04:17 -05:00 committed by GitHub
parent a1bfcedf80
commit 83ff6fea00
1 changed files with 1 additions and 1 deletions

View File

@ -2057,7 +2057,7 @@ class PdfFileReader(object):
if encrypt['/Filter'] != '/Standard':
raise NotImplementedError("only Standard PDF encryption handler is available")
if not (encrypt['/V'] in (1, 2)):
raise NotImplementedError("only algorithm code 1 and 2 are supported")
raise NotImplementedError("only algorithm code 1 and 2 are supported. This PDF uses code %s" % encrypt['/V'])
user_password, key = self._authenticateUserPassword(password)
if user_password:
self._decryption_key = key