From fe6477f75f6e403df57ae8a2469a612c92a72ed9 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 27 Nov 2019 23:26:25 +0100 Subject: [PATCH] OggEncoder: specify list args for subprocess.call --- flacsync/encoder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flacsync/encoder.py b/flacsync/encoder.py index d1cb542..4d068c6 100644 --- a/flacsync/encoder.py +++ b/flacsync/encoder.py @@ -266,8 +266,7 @@ def encode( self, force=False ): if force or util.newer( self.src, self.dst): self._pre_encode() # encode to OGG - err = sp.call( 'oggenc -q %s -o "%s" "%s"' % - (self.q, self.dst, self.src), shell=True, stderr=NULL) + err = sp.call(['oggenc', '-q', self.q, '-o', self.dst, self.src], stderr=NULL) if err == -2: # keyboard interrupt os.remove(self.dst) # clean-up partial file raise KeyboardInterrupt @@ -331,8 +330,7 @@ def set_cover( self, force=False, resize=False ): len(bin_cover), bin_cover) meta_block = base64.b64encode(meta_block) - err = sp.call( 'vorbiscomment -a -t "META_BLOCK_PICTURE=%s" "%s"' % - (meta_block, self.dst), shell=True, stderr=NULL) + err = sp.call(['vorbiscomment', '-a', '-t', "META_BLOCK_PICTURE=%s" % meta_block, self.dst], stderr=NULL) return self._check_err( err, "OGG add-cover failed:" )