MCPcopy Index your code
hub / github.com/docker/docker-py / simple_tar

Function simple_tar

tests/helpers.py:30–39  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

28
29
30def simple_tar(path):
31 f = tempfile.NamedTemporaryFile()
32 t = tarfile.open(mode='w', fileobj=f)
33
34 abs_path = os.path.abspath(path)
35 t.add(abs_path, arcname=os.path.basename(path), recursive=False)
36
37 t.close()
38 f.seek(0)
39 return f
40
41
42def untar_file(tardata, filename):

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected