diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-10-14 20:12:06 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-10-14 20:12:06 (GMT) |
commit | d0e2705f3ff978962b909346ffbd4f8e1c33154d (patch) | |
tree | 97cd8c2ab628816c53782a2024d8749332cda1c2 /Lib | |
parent | c2a2832bee2d30119981d7924223823b3f099662 (diff) | |
download | cpython-d0e2705f3ff978962b909346ffbd4f8e1c33154d.zip cpython-d0e2705f3ff978962b909346ffbd4f8e1c33154d.tar.gz cpython-d0e2705f3ff978962b909346ffbd4f8e1c33154d.tar.bz2 |
Open results files, which contain binary pickles, in binary mode.
Remove fallback code that tries to read marshal data from a results
file, since this module never writes marshal data.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/trace.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/trace.py b/Lib/trace.py index ade55bd..7f41263 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -204,13 +204,11 @@ class CoverageResults: if self.infile: # Try to merge existing counts file. try: - counts, calledfuncs = pickle.load(open(self.infile, 'r')) + counts, calledfuncs = pickle.load(open(self.infile, 'rb')) self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err: print >> sys.stderr, ("Skipping counts file %r: %s" % (self.infile, err)) - except pickle.UnpicklingError: - self.update(self.__class__(marshal.load(open(self.infile)))) def update(self, other): """Merge in the data from another CoverageResults""" @@ -288,7 +286,7 @@ class CoverageResults: # try and store counts and module info into self.outfile try: pickle.dump((self.counts, self.calledfuncs), - open(self.outfile, 'w'), 1) + open(self.outfile, 'wb'), 1) except IOError, err: print >> sys.stderr, "Can't save counts files because %s" % err |