bpo-31993: Do not create frames for large bytes and str objects (#5114)

when serialize into memory buffer with C pickle implementations.

This optimization already is performed when serialize into memory
with Python pickle implementations or into a file with both
implementations.
This commit is contained in:
Serhiy Storchaka 2018-01-11 13:03:20 +02:00 committed by GitHub
parent cb3ae5588b
commit 0a2da50e18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 97 additions and 104 deletions

View file

@ -71,8 +71,6 @@ class PyPicklerTests(AbstractPickleTests):
class InMemoryPickleTests(AbstractPickleTests, AbstractUnpickleTests,
BigmemPickleTests):
pickler = pickle._Pickler
unpickler = pickle._Unpickler
bad_stack_errors = (pickle.UnpicklingError, IndexError)
truncated_errors = (pickle.UnpicklingError, EOFError,
AttributeError, ValueError,
@ -84,6 +82,8 @@ class InMemoryPickleTests(AbstractPickleTests, AbstractUnpickleTests,
def loads(self, buf, **kwds):
return pickle.loads(buf, **kwds)
test_framed_write_sizes_with_delayed_writer = None
class PersistentPicklerUnpicklerMixin(object):