예제 #1
0
def unpack(
        stream,
        *,
        raw=True,
        unicode_errors=None,
        strict_map_key=False,
        max_str_len=2147483647,  # 2**32-1
        max_bin_len=2147483647,
        max_array_len=2147483647,
        max_map_len=2147483647,
        max_ext_len=2147483647,
        **kwargs):
    assert unicode_errors is None
    try:
        kw = dict(raw=raw,
                  unicode_errors=unicode_errors,
                  max_str_len=max_str_len,
                  max_bin_len=max_bin_len,
                  max_array_len=max_array_len,
                  max_map_len=max_map_len,
                  max_ext_len=max_ext_len)
        kw.update(kwargs)
        if _post_100:
            kw['strict_map_key'] = strict_map_key
        return mp_unpack(stream, **kw)
    except Exception as e:
        raise UnpackException(e)
예제 #2
0
def unpack(
        stream,
        *,
        raw=True,
        encoding=None,
        unicode_errors=None,
        max_str_len=2147483647,  # 2**32-1
        max_bin_len=2147483647,
        max_array_len=2147483647,
        max_map_len=2147483647,
        max_ext_len=2147483647,
        **kwargs):
    assert raw is True
    assert encoding is None
    assert unicode_errors is None
    try:
        return mp_unpack(stream,
                         raw=raw,
                         encoding=encoding,
                         unicode_errors=unicode_errors,
                         max_str_len=max_str_len,
                         max_bin_len=max_bin_len,
                         max_array_len=max_array_len,
                         max_map_len=max_map_len,
                         max_ext_len=max_ext_len,
                         **kwargs)
    except Exception as e:
        raise UnpackException(e)
예제 #3
0
파일: msgpack.py 프로젝트: wxlg1117/borg
def unpack(stream, *, raw=True, encoding=None, unicode_errors=None, **kwargs):
    assert raw is True
    assert encoding is None
    assert unicode_errors is None
    try:
        return mp_unpack(stream,
                         raw=raw,
                         encoding=encoding,
                         unicode_errors=unicode_errors,
                         **kwargs)
    except Exception as e:
        raise UnpackException(e)
예제 #4
0
def unpack(stream,
           *,
           raw=True,
           unicode_errors=None,
           strict_map_key=False,
           **kwargs):
    assert unicode_errors is None
    try:
        kw = dict(raw=raw,
                  unicode_errors=unicode_errors,
                  strict_map_key=strict_map_key)
        kw.update(kwargs)
        return mp_unpack(stream, **kw)
    except Exception as e:
        raise UnpackException(e)
예제 #5
0
def unpack(stream, *, raw=True, encoding=None, unicode_errors=None,
           max_str_len=2147483647,  # 2**32-1
           max_bin_len=2147483647,
           max_array_len=2147483647,
           max_map_len=2147483647,
           max_ext_len=2147483647,
           **kwargs):
    assert raw is True
    assert encoding is None
    assert unicode_errors is None
    try:
        return mp_unpack(stream, raw=raw, encoding=encoding, unicode_errors=unicode_errors,
                         max_str_len=max_str_len,
                         max_bin_len=max_bin_len,
                         max_array_len=max_array_len,
                         max_map_len=max_map_len,
                         max_ext_len=max_ext_len,
                         **kwargs)
    except Exception as e:
        raise UnpackException(e)