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

Function _to_msgpack

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

Source from the content-addressed store, hash-verified

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