Show
Ignore:
Timestamp:
02/08/07 22:23:59 (18 years ago)
Author:
jerome
Message:

Now uses Python's universal newline detection to read input files,
and also uses file objects directly instead of calling their xreadlines()
method.
Fixed an accounting problem in the PDF parser for some type of files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/analyzer.py

    r443 r450  
    110110        else :     
    111111            # normal file 
    112             self.infile = open(self.filename, "rb") 
     112            self.infile = open(self.filename, "rbU") 
    113113            self.mustclose = 1 
    114114            return 
    115115             
    116116        # Use a temporary file, always seekable contrary to standard input. 
    117         self.infile = tempfile.TemporaryFile(mode="w+b") 
     117        self.infile = tempfile.TemporaryFile(mode="w+bU") 
    118118        while 1 : 
    119119            data = infile.read(pdlparser.MEGABYTE)