Merge pull request #303 from moshekaplan/patch-1

Additional error output for failed encryption
This commit is contained in:
Matthew Stamy 2017-01-04 20:06:30 -06:00 committed by GitHub
commit d7b8d3e0f4
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