From e5d73db9db746715aca974e5cc9f01461d86148f Mon Sep 17 00:00:00 2001 From: Yo'av Moshe Date: Fri, 19 Apr 2024 19:26:48 +0200 Subject: [PATCH] fix downloading of models in the python binding models come in files named like `csen.student.base.v1.cd5418ba6a412fc7.tar.gz`, but the directory they create when extracted are named like `csen.student.base`. we therefore need to remove not just the extension but everything following and including the 3rd period --- bindings/python/repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/repository.py b/bindings/python/repository.py index 9667c7242..9ea3ac023 100644 --- a/bindings/python/repository.py +++ b/bindings/python/repository.py @@ -180,7 +180,7 @@ def safe_extract(tar, path=".", members=None, *, numeric_owner=False): def _archive_name_without_extension(self, url: URL): o = urlparse(url) fname = os.path.basename(o.path) # something tar.gz. - fname_without_extension = fname.replace(".tar.gz", "") + fname_without_extension = ".".join(fname.split(".")[:3]) return fname_without_extension