summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-08-27 17:37:12 +0200
committerGuido Günther <agx@sigxcpu.org>2017-08-27 17:37:12 +0200
commit6d3e34ce3fe1c4e19bc1f218bc8299d14cbd2ada (patch)
tree5e30d766845146930a296352cbd21c57eab72d51
parent9dc2129c4448416f43300ce859f1e1f4a1070048 (diff)
patch_seris: report decoding errors when reading patch files
-rw-r--r--gbp/patch_series.py4
1 files 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)