[PATCH] ui: ignore EIO in write_err
Mads Kiilerich
mads at kiilerich.com
Tue Jun 15 17:24:55 CDT 2010
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1276640530 -7200
# Node ID 7a3d95782e0b74523ab4ce4129d392b38058060e
# Parent ad0a334eef163df857c36fdca2bd4daadba9df99
ui: ignore EIO in write_err
Hgs signal handler will catch the signal for example if the terminal hg is
running in is closed. That will make it try to warn that it was 'killed', but
that might fail with EIO and cause hg to exit with an unhandled exception.
Normally nobody cares, but system error handlers such as Fedoras abrt will
notice and report https://bugzilla.redhat.com/show_bug.cgi?id=596594 .
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -369,7 +369,7 @@
if not getattr(sys.stderr, 'closed', False):
sys.stderr.flush()
except IOError, inst:
- if inst.errno != errno.EPIPE:
+ if inst.errno not in [errno.EPIPE, errno.EIO]:
raise
def flush(self):
More information about the Mercurial-devel
mailing list