diff --git a/beetsplug/convert.py b/beetsplug/convert.py index de91604f5..8c7f20e4d 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -199,9 +199,10 @@ class ConvertPlugin(BeetsPlugin): # Something went wrong (probably Ctrl+C), remove temporary files self._log.info(u'Encoding {0} failed. Cleaning up...', util.displayable_path(source)) - self._log.debug(u'Command {0} exited with status {1}', - exc.cmd.decode('utf8', 'ignore'), - exc.returncode) + self._log.debug(u'Command {0} exited with status {1}: {2}', + args, + exc.returncode, + exc.output) util.remove(dest) util.prune_dirs(os.path.dirname(dest)) raise diff --git a/test/test_convert.py b/test/test_convert.py index 886614822..ef37466d7 100644 --- a/test/test_convert.py +++ b/test/test_convert.py @@ -35,10 +35,12 @@ class TestHelper(helper.TestHelper): if re.search('[^a-zA-Z0-9]', tag): raise ValueError(u"tag '{0}' must only contain letters and digits" .format(tag)) - # FIXME This is not portable. For windows we need to use our own - # python script that performs the same task. - return u'sh -c "cp \'$source\' \'$dest\'; ' \ - u'printf {0} >> \'$dest\'"'.format(tag) + + # A Python script that copies the file and appends a tag. + return u'python -c \'import sys; inf = open(sys.argv[1], "rb"); ' \ + u'outf = open(sys.argv[2], "wb"); ' \ + u'outf.write(inf.read()); ' \ + u'outf.write(b"{}")\' $source $dest'.format(tag) def assertFileTag(self, path, tag): # noqa """Assert that the path is a file and the files content ends with `tag`.