From eb85ff422b9295b3831cab58004677c3a8d4a817 Mon Sep 17 00:00:00 2001 From: Kier Davis Date: Fri, 16 Dec 2016 00:21:35 +0000 Subject: [PATCH] convert plugin: fix braces in filenames causing tracebacks in "pretend" mode Previously "pretend" mode (a.k.a. dry run mode) passed the command to be printed directly to _log.info, whose first argument is technically a format string. Thus the command string was parsed for replacement fields, such as '{foo}', which could cause the format evaluation to fail if the filenames contained in the command contained valid (or partially valid) replacement fields. This fix simply inserts an argument '{0}' to the call to _log.info, which is a format string that simply evaluates to the second argument to _log.info (the command string). By doing this, the command string is not parsed for replacement fields. --- beetsplug/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/convert.py b/beetsplug/convert.py index 6639eb7b1..dfdf4e310 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -202,7 +202,7 @@ class ConvertPlugin(BeetsPlugin): encode_cmd.append(args[i].encode(util.arg_encoding())) if pretend: - self._log.info(u' '.join(ui.decargs(args))) + self._log.info(u'{0}', u' '.join(ui.decargs(args))) return try: