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

Method get_archive

tests/sandbox/test_docker.py:77–89  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

75 return
76
77 def get_archive(self, path: str) -> tuple[object, dict[str, object]]:
78 self.archive_calls.append(path)
79 if self.archive_error is not None:
80 raise self.archive_error
81 if path == "/workspace":
82 raise docker.errors.APIError("root archive unsupported")
83
84 host_path = self._host_path(path)
85 buf = io.BytesIO()
86 with tarfile.open(fileobj=buf, mode="w") as tar:
87 tar.add(host_path, arcname=Path(path).name)
88 buf.seek(0)
89 return iter([buf.getvalue()]), {}
90
91 def _host_path(self, path: str | Path) -> Path:
92 container_path = Path(path)

Callers 1

Calls 5

_host_pathMethod · 0.95
appendMethod · 0.80
openMethod · 0.80
addMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected