pyPdf fails to read non-encrypted document raising "file has not been decrypted"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyPdf |
New
|
Undecided
|
Unassigned |
Bug Description
Trying to get a reference of the first page of the attached pdf document raises the exception "file has not been decrypted" even though the document is not encrypted. See below:
>>> input = pyPdf.PdfFileRe
>>> page = input.getPage(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/
self._flatten()
File "/var/lib/
catalog = self.trailer[
File "/var/lib/
return dict.__
File "/var/lib/
return self.pdf.
File "/var/lib/
raise Exception, "file has not been decrypted"
Exception: file has not been decrypted
I 've found out that the document is recognized from pyPdf as encrypted. I tried to decrypt it using an empty string as password and it worked. Trying to decrypt the document with any other string failed.
>>> input.getIsEncr ypted() 'dcdsfvcfd' )
True
>>> input.decrypt('')
1
>>> input.decrypt(
0