How to use the zodbpickle.binary._pack function in zodbpickle

To help you get started, we’ve selected a few zodbpickle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nexedi / neoppod / neo / client / __init__.py View on Github external
def patch():
    # For msgpack & Py2/ZODB5.
    try:
        from zodbpickle import binary
        binary._pack = bytes.__str__
    except ImportError:
        pass

    from hashlib import md5
    from ZODB.Connection import Connection

    H = lambda f: md5(f.func_code.co_code).hexdigest()

    # Allow serial to be returned as late as tpc_finish
    #
    # This makes possible for storage to allocate serial inside tpc_finish,
    # removing the requirement to serialise second commit phase (tpc_vote
    # to tpc_finish/tpc_abort).

    h = H(Connection.tpc_finish)

zodbpickle

Fork of Python 3 pickle module.

Python-2.0
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis