handle "broken pipe" error (#204)

This commit is contained in:
Adrian Sampson 2011-06-12 22:36:18 -07:00
parent a7b7cb69c0
commit 52239cf900
2 changed files with 8 additions and 0 deletions

1
NEWS
View file

@ -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

View file

@ -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