Making sure files and versions are consistent

This commit is contained in:
Apprentice Harper
2016-10-07 17:32:13 +01:00
parent 5eb3338423
commit 92ce0396fe
7 changed files with 50 additions and 21 deletions

View File

@@ -3,13 +3,13 @@
from __future__ import with_statement
# adobekey.pyw, version 5.7
# adobekey.pyw, version 6.0
# Copyright © 2009-2010 i♥cabbages
# Released under the terms of the GNU General Public Licence, version 3
# <http://www.gnu.org/licenses/>
# Modified 20102013 by some_updates, DiapDealer and Apprentice Alf
# Modified 20102016 by several people
# Windows users: Before running this program, you must first install Python.
# We recommend ActiveState Python 2.7.X for Windows (x86) from

View File

@@ -57,6 +57,7 @@ from __future__ import with_statement
# 8.0.2 - Add additional check on DER file sanity
# 8.0.3 - Remove erroneous check on DER file sanity
# 8.0.4 - Completely remove erroneous check on DER file sanity
# 8.0.5 - Do not process DRM-free documents
"""
@@ -64,7 +65,7 @@ Decrypts Adobe ADEPT-encrypted PDF files.
"""
__license__ = 'GPL v3'
__version__ = "8.0.4"
__version__ = "8.0.5"
import sys
import os
@@ -1468,6 +1469,7 @@ class PDFDocument(object):
if not self.encryption:
self.is_printable = self.is_modifiable = self.is_extractable = True
self.ready = True
raise PDFEncryptionError('Document is not encrypted.')
return
(docid, param) = self.encryption
type = literal_name(param['Filter'])
@@ -2180,11 +2182,11 @@ def decryptBook(userkey, inpath, outpath):
if RSA is None:
raise ADEPTError(u"PyCrypto or OpenSSL must be installed.")
with open(inpath, 'rb') as inf:
try:
serializer = PDFSerializer(inf, userkey)
except:
print u"Error serializing pdf {0}. Probably wrong key.".format(os.path.basename(inpath))
return 2
#try:
serializer = PDFSerializer(inf, userkey)
#except:
# print u"Error serializing pdf {0}. Probably wrong key.".format(os.path.basename(inpath))
# return 2
# hope this will fix the 'bad file descriptor' problem
with open(outpath, 'wb') as outf:
# help construct to make sure the method runs to the end