summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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)