MCPcopy Create free account
hub / github.com/openai/openai-agents-python / _tar_bytes

Function _tar_bytes

tests/sandbox/test_extract.py:118–126  ·  view source on GitHub ↗
(*, members: dict[str, bytes])

Source from the content-addressed store, hash-verified

116
117
118def _tar_bytes(*, members: dict[str, bytes]) -> io.BytesIO:
119 buf = io.BytesIO()
120 with tarfile.open(fileobj=buf, mode="w") as archive:
121 for name, payload in members.items():
122 info = tarfile.TarInfo(name=name)
123 info.size = len(payload)
124 archive.addfile(info, io.BytesIO(payload))
125 buf.seek(0)
126 return buf
127
128
129def _zip_bytes(*, members: dict[str, bytes]) -> io.BytesIO:

Calls 2

openMethod · 0.80
seekMethod · 0.45

Tested by

no test coverage detected