MCPcopy Create free account
hub / github.com/ccxt/ccxt / unpackb

Function unpackb

python/ccxt/static_dependencies/msgpack/fallback.py:77–99  ·  view source on GitHub ↗

Unpack an object from `packed`. Raises ``ExtraData`` when *packed* contains extra bytes. Raises ``ValueError`` when *packed* is incomplete. Raises ``FormatError`` when *packed* is not valid msgpack. Raises ``StackError`` when *packed* contains too nested. Other exceptions c

(packed, **kwargs)

Source from the content-addressed store, hash-verified

75
76
77def unpackb(packed, **kwargs):
78 """
79 Unpack an object from `packed`.
80
81 Raises ``ExtraData`` when *packed* contains extra bytes.
82 Raises ``ValueError`` when *packed* is incomplete.
83 Raises ``FormatError`` when *packed* is not valid msgpack.
84 Raises ``StackError`` when *packed* contains too nested.
85 Other exceptions can be raised during unpacking.
86
87 See :class:`Unpacker` for options.
88 """
89 unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs)
90 unpacker.feed(packed)
91 try:
92 ret = unpacker._unpack()
93 except OutOfData:
94 raise ValueError("Unpack failed: incomplete input")
95 except RecursionError:
96 raise StackError
97 if unpacker._got_extradata():
98 raise ExtraData(ret, unpacker._get_extradata())
99 return ret
100
101
102_NO_FORMAT_USED = ""

Callers 1

unpackFunction · 0.85

Calls 6

feedMethod · 0.95
_unpackMethod · 0.95
_got_extradataMethod · 0.95
_get_extradataMethod · 0.95
UnpackerClass · 0.85
ExtraDataClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…