From: Date: Thu, 27 Dec 2012 03:06:24 +0000 (-0800) Subject: Oops, really unify, and also fix SubprocessError to consume the stderr stream. X-Git-Url: https://diplodocus.org/git/flac-archive/commitdiff_plain/73112f3f050b8f78a6d03449c00a60c6a30f715e Oops, really unify, and also fix SubprocessError to consume the stderr stream. --- diff --git a/rewrite-tags b/rewrite-tags index d4ce48c..a3b5eb6 100755 --- a/rewrite-tags +++ b/rewrite-tags @@ -20,7 +20,7 @@ class SubprocessError(Exception): Exception.__init__(self, msg % (abs(status), command_msg)) self.status = status self.command = command - self.stderr = stderr + self.stderr = ''.join(stderr) def get_tags(fn): tags = Tags() @@ -43,10 +43,9 @@ def rewrite_track_tags(track, tags, fn, tmp): '--remove-all-tags', '--import-tags-from', tmp.name, fn] p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - stdout, stderr = p.communicate() status = p.wait() if status != 0: - raise SubprocessError(status, command=command, stderr=stdout) + raise SubprocessError(status, command=command, stderr=p.stdout) def do_read(filenames): # Use this mapping of tag names to sets of tag values to detect global tags.