The picklers do no longer allocate temporary memory when dumping large
bytes and str objects into a file object. Instead the data is
directly streamed into the underlying file object.
Previously the C implementation would buffer all content and issue a
single call to file.write() at the end of the dump. With protocol 4
this behavior has changed to issue one call to file.write() per frame.
The Python pickler with protocol 4 now dumps each frame content as a
memoryview to an IOBytes instance that is never reused and the
memoryview is no longer released after the call to write. This makes it
possible for the file object to delay access to the memoryview of
previous frames without forcing any additional memory copy as was
already possible with the C pickler.
or dumping pickles with a 2.x-compatible protocol, in order to make data
sharing and migration easier. This behaviour can be disabled using the
new `fix_imports` optional argument.
for bytes. This is the default protocol. It intentionally cannot
be unpickled by Python 2.x.
- When a pickle written by Python 2.x contains an (8-bit) str
instance, this is now decoded to a (Unicode) str instance. The
encoding used to do this defaults to ASCII, but can be overridden
via two new keyword arguments to the Unpickler class. Previously
this would create bytes instances, which is usually wrong: str
instances are often used to pickle attribute names etc., and text is
more common than binary data anyway.
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60731 | raymond.hettinger | 2008-02-11 19:51:08 +0100 (Mon, 11 Feb 2008) | 1 line
No need to register classes that already inherit from ABCs.
........
r60733 | lars.gustaebel | 2008-02-11 20:17:10 +0100 (Mon, 11 Feb 2008) | 2 lines
Make sure that xstar headers are read correctly.
........
r60734 | raymond.hettinger | 2008-02-11 21:05:53 +0100 (Mon, 11 Feb 2008) | 1 line
Add tests for pickletools.optimize().
........