From e0b94208a9300da9229711750583f5f990886f6d Mon Sep 17 00:00:00 2001 From: Date: Mon, 9 Dec 2013 00:15:46 -0800 Subject: [PATCH] Oops, fix improper use of a quoted fn when reading pic with metaflac --- flac2mp3 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flac2mp3 b/flac2mp3 index e4eaa22..b2fc719 100755 --- 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) + unquoted_fn = fn + # 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) - 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 -- 2.56.0