Skip to content

Commit

Permalink
Fixed len calculation when taring script
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicz committed Feb 15, 2018
1 parent 27d1b75 commit 94ee0be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arca/backend/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,11 @@ def tar_script(self, name, script):
tar = tarfile.TarFile(fileobj=tarstream, mode='w')
tarinfo = tarfile.TarInfo(name=name)

script = script.encode("utf-8")

tarinfo.size = len(script)
tarinfo.mtime = time.time()
tar.addfile(tarinfo, BytesIO(script.encode("utf-8")))
tar.addfile(tarinfo, BytesIO(script))
tar.close()

return tarstream.getvalue()
Expand Down

0 comments on commit 94ee0be

Please sign in to comment.