From 6d3e34ce3fe1c4e19bc1f218bc8299d14cbd2ada Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 27 Aug 2017 17:37:12 +0200 Subject: patch_seris: report decoding errors when reading patch files --- gbp/patch_series.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gbp/patch_series.py b/gbp/patch_series.py index 21b2ad63..2cffe099 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -76,9 +76,9 @@ class Patch(object): try: self.long_desc = "".join([l.decode() for l in body]) body.close() - except IOError as msg: + except (IOError, UnicodeDecodeError) as msg: raise GbpError("Failed to read patch header of '%s': %s" % - (self.patch, msg)) + (self.path, msg)) finally: if os.path.exists(body.name): os.unlink(body.name) -- cgit v1.2.3