Fix tarfile

This commit is contained in:
Timmy Welch 2023-12-25 22:59:57 -08:00
parent 6e56872121
commit 39407286b3

View File

@ -43,7 +43,7 @@ def addToTar(tf: tarfile.TarFile, path: str, zippath: str) -> None:
def Tar(tar_file: pathlib.Path, path: pathlib.Path) -> None:
tar_file.unlink(missing_ok=True)
with tarfile.TarFile(f"{tar_file}.tar.gz", "w:gz") as tf: # type: ignore[arg-type]
with tarfile.open(f"{tar_file}.tar.gz", "w:gz") as tf:
zippath = os.path.basename(path)
if not zippath:
zippath = os.path.basename(os.path.dirname(path))