From 7050ad4dec5b2dfc644983fa1b5ebe520496bb32 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov <41117609+azhavoro@users.noreply.github.com> Date: Tue, 10 Mar 2020 22:49:11 +0300 Subject: [PATCH] fixed git sync app (#1247) * fixed git sync app * removed shell=True for subprocess call --- 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..4f35812ba2de 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.run(args=['7z', 'a', self._annotation_file, dump_name]) elif ext == '.xml': shutil.copyfile(dump_name, self._annotation_file) else: