From af44f3fa50040745698766239291eba3ff8c5626 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Tue, 10 Mar 2020 16:22:27 +0300 Subject: [PATCH 1/2] fixed git sync app --- cvat/apps/git/git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat/apps/git/git.py b/cvat/apps/git/git.py index 1874b25ce5f2..e5fad268528b 100644 --- a/cvat/apps/git/git.py +++ b/cvat/apps/git/git.py @@ -271,7 +271,7 @@ def push(self, user, scheme, host, db_task, last_save): display_name += " for images" if self._task_mode == "annotation" else " for videos" cvat_dumper = AnnotationDumper.objects.get(display_name=display_name) dump_name = os.path.join(db_task.get_task_dirname(), - "git_annotation_{}.".format(timestamp) + "dump") + "git_annotation_{}.xml".format(timestamp)) dump_task_data( pk=self._tid, user=user, @@ -283,7 +283,7 @@ def push(self, user, scheme, host, db_task, last_save): ext = os.path.splitext(self._path)[1] if ext == '.zip': - subprocess.call('zip -j -r "{}" "{}"'.format(self._annotation_file, dump_name), shell=True) + subprocess.call('7z a "{}" "{}"'.format(self._annotation_file, dump_name), shell=True) elif ext == '.xml': shutil.copyfile(dump_name, self._annotation_file) else: From bc56cbd13a35ce1f45936061279ddd32881a60df Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Tue, 10 Mar 2020 17:57:46 +0300 Subject: [PATCH 2/2] removed shell=True for subprocess call --- cvat/apps/git/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat/apps/git/git.py b/cvat/apps/git/git.py index e5fad268528b..4f35812ba2de 100644 --- a/cvat/apps/git/git.py +++ b/cvat/apps/git/git.py @@ -283,7 +283,7 @@ def push(self, user, scheme, host, db_task, last_save): ext = os.path.splitext(self._path)[1] if ext == '.zip': - subprocess.call('7z a "{}" "{}"'.format(self._annotation_file, dump_name), shell=True) + subprocess.run(args=['7z', 'a', self._annotation_file, dump_name]) elif ext == '.xml': shutil.copyfile(dump_name, self._annotation_file) else: