Changeset 778

Show
Ignore:
Timestamp:
12/15/06 15:50:58 (2 years ago)
Author:
mfenniak
Message:

fix bugs with unencrypted files that were stupidly not tested before 1.8 release

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pypdf/trunk/pyPdf/pdf.py

    r775 r778  
    173173            stream.write(str(idnum) + " 0 obj\n") 
    174174            key = None 
    175             if idnum != self._encrypt.idnum and hasattr(self, "_encrypt_key")
     175            if hasattr(self, "_encrypt") and idnum != self._encrypt.idnum
    176176                pack1 = struct.pack("<i", i + 1)[:3] 
    177177                pack2 = struct.pack("<i", 0)[:2] 
     
    408408 
    409409        # override encryption is used for the /Encrypt dictionary 
    410         if not self._override_encryption
     410        if not self._override_encryption and self.isEncrypted
    411411            # if we don't have the encryption key: 
    412             if self.isEncrypted and not hasattr(self, '_decryption_key'): 
     412            if not hasattr(self, '_decryption_key'): 
    413413                raise Exception, "file has not been decrypted" 
    414414            # otherwise, decrypt here...