Exemplo n.º 1
0
def server_decode(msg):
    """Decodes msg and returns its parts"""
    unpickler = Unpickler(BytesIO(msg))
    unpickler.find_global = server_find_global

    try:
        return unpickler.load() # msgid, flags, name, args
    except:
        log("can't decode message: %s" % short_repr(msg),
            level=logging.ERROR)
        raise
Exemplo n.º 2
0
def decode(msg):
    """Decodes msg and returns its parts"""
    unpickler = Unpickler(BytesIO(msg))
    unpickler.find_global = find_global
    try:
        unpickler.find_class = find_global  # PyPy, zodbpickle, the non-c-accelerated version
    except AttributeError:
        pass
    try:
        return unpickler.load()  # msgid, flags, name, args
    except:
        log("can't decode message: %s" % short_repr(msg), level=logging.ERROR)
        raise
Exemplo n.º 3
0
def decode(msg):
    """Decodes msg and returns its parts"""
    unpickler = Unpickler(BytesIO(msg))
    unpickler.find_global = find_global
    try:
        unpickler.find_class = find_global # PyPy, zodbpickle, the non-c-accelerated version
    except AttributeError:
        pass
    try:
        return unpickler.load() # msgid, flags, name, args
    except:
        log("can't decode message: %s" % short_repr(msg),
            level=logging.ERROR)
        raise