(*, members: dict[str, bytes])
| 116 | |
| 117 | |
| 118 | def _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 | |
| 129 | def _zip_bytes(*, members: dict[str, bytes]) -> io.BytesIO: |
no test coverage detected