From: Date: Mon, 9 Dec 2013 08:15:46 +0000 (-0800) Subject: Oops, fix improper use of a quoted fn when reading pic with metaflac X-Git-Url: https://diplodocus.org/git/flac-archive/commitdiff_plain/e0b94208a9300da9229711750583f5f990886f6d?hp=914a40ceff9f0035e59993e04c3b123d71170c57 Oops, fix improper use of a quoted fn when reading pic with metaflac --- 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