]> diplodocus.org Git - flac-archive/commitdiff
Oops, fix improper use of a quoted fn when reading pic with metaflac
author <epg@pretzelnet.org> <>
Mon, 9 Dec 2013 08:15:46 +0000 (00:15 -0800)
committer <epg@pretzelnet.org> <>
Mon, 9 Dec 2013 08:15:46 +0000 (00:15 -0800)
flac2mp3

index e4eaa22..b2fc719 100755 (executable)
--- a/flac2mp3
+++ b/flac2mp3
@@ -88,6 +88,8 @@ def flac2mp3(fn, title, artist, album_artist, album, discnum, date,
     verbose and tmp.append('--verbose')
     lame_options = ' '.join(tmp)
 
     verbose and tmp.append('--verbose')
     lame_options = ' '.join(tmp)
 
+    unquoted_fn = fn
+
     # Escape any single quotes ' so we can quote this.
     (fn, title, artist, album_artist,
      album, date) = [(x or '').replace("'", r"'\''")
     # Escape any single quotes ' so we can quote this.
     (fn, title, artist, album_artist,
      album, date) = [(x or '').replace("'", r"'\''")
@@ -112,7 +114,8 @@ def flac2mp3(fn, title, artist, album_artist, album, discnum, date,
     pic_options = ''
     (fd, picfn) = tempfile.mkstemp()
     os.close(fd)
     pic_options = ''
     (fd, picfn) = tempfile.mkstemp()
     os.close(fd)
-    p = Popen(['metaflac', '--export-picture-to', picfn, fn], stderr=PIPE)
+    p = Popen(['metaflac', '--export-picture-to', picfn, unquoted_fn],
+              stderr=PIPE)
     status = p.wait()
     stderr = ''.join(p.stderr)
     # Hacky check for flac with no album art
     status = p.wait()
     stderr = ''.join(p.stderr)
     # Hacky check for flac with no album art