From 603379eb37c3b743ba49aab2d6563e1caa9adbe0 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Fri, 28 Jun 2013 06:40:09 +0000 Subject: [PATCH] Change _copy_data() error handling to explain errors not due to broken pipes. --- gnupg/_util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnupg/_util.py b/gnupg/_util.py index 3cb6342..3ce7c11 100644 --- a/gnupg/_util.py +++ b/gnupg/_util.py @@ -145,9 +145,12 @@ def _copy_data(instream, outstream): except IOError: log.exception("Error sending data: Broken pipe") break - except IOError: + except IOError as ioe: # Can get 'broken pipe' errors even when all data was sent - log.exception('Error sending data: Broken pipe') + if 'Broken pipe' in ioe.message: + log.error('Error sending data: Broken pipe') + else: + log.exception(ioe) break try: outstream.close()