diff --git a/NEWS b/NEWS index 7333545d3..0db887293 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,7 @@ * Fix an issue that was causing mpdupdate to run twice for every album. * Fix a bug that caused release dates/years not to be fetched. * Fix a crasher when setting MBIDs on MP3s file metadata. +* Fix a "broken pipe" error when piping beets' standard output. * A better error message is given when the database file is unopenable. 1.0b8 diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 1f5b04c46..9ee621c4b 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -25,6 +25,7 @@ import sys from difflib import SequenceMatcher import logging import sqlite3 +import errno from beets import library from beets import plugins @@ -607,3 +608,9 @@ def main(args=None, configfh=None): except UserError, exc: message = exc.args[0] if exc.args else None subcommand.parser.error(message) + except IOError, exc: + if exc.errno == errno.EPIPE: + # "Broken pipe". End silently. + pass + else: + raise