MCPcopy Create free account
hub / github.com/cdgriffith/Box / _to_msgpack

Function _to_msgpack

box/from_file.py:72–80  ·  view source on GitHub ↗
(file, _, __, **kwargs)

Source from the content-addressed store, hash-verified

70
71
72def _to_msgpack(file, _, __, **kwargs):
73 if not msgpack_available:
74 raise BoxError(f'File "{file}" is msgpack but no package is available to open it. Please install "msgpack"')
75 try:
76 return Box.from_msgpack(filename=file, **kwargs)
77 except (UnpackException, ValueError):
78 raise BoxError("File is not msgpack as expected")
79 except BoxError:
80 return BoxList.from_msgpack(filename=file, **kwargs)
81
82
83def _to_toon(file, encoding, errors, **kwargs):

Callers

nothing calls this directly

Calls 2

BoxErrorClass · 0.90
from_msgpackMethod · 0.45

Tested by

no test coverage detected