avoid passing open network connections to subprocesses, call Popen with close_fds=True

This commit is contained in:
j 2014-09-02 14:24:12 +00:00
commit 72d9dbf0f2
7 changed files with 24 additions and 20 deletions

View file

@ -271,7 +271,7 @@ class Edit(models.Model):
'-f', ','.join(frames),
'-o', icon
]
p = subprocess.Popen(cmd)
p = subprocess.Popen(cmd, close_fds=True)
p.wait()
self.save()
@ -355,12 +355,12 @@ class Edit(models.Model):
'-ss', data['in'], '-t', data['out'],
'-vcodec', 'copy', '-acodec', 'copy',
clips[-1]]
#p = subprocess.Popen(cmd)
#p = subprocess.Popen(cmd, close_fds=True)
#p.wait()
cmd = ['mkvmerge', clips[0]] \
+ ['+'+c for c in clips[1:]] \
+ [os.path.join(tmp, 'render.webm')]
#p = subprocess.Popen(cmd)
#p = subprocess.Popen(cmd, close_fds=True)
#p.wait()
shutil.rmtree(tmp)