Skip to content

Commit

Permalink
fixed git sync app (#1247)
Browse files Browse the repository at this point in the history
* fixed git sync app

* removed shell=True for subprocess call
  • Loading branch information
azhavoro authored Mar 10, 2020
1 parent ec2fa6e commit 7050ad4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cvat/apps/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down

0 comments on commit 7050ad4

Please sign in to comment.