summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-09-15 14:31:44 +0200
committerGuido Günther <agx@sigxcpu.org>2017-09-15 14:31:44 +0200
commitfdf2720ca269cd9b6499c0d1eae1a908463badaa (patch)
treea17e39c98a4cf386a4b6e7c70d796a42b9e7f22b
parentba266b8ba4aedf4f3a8f621ec5bcb1bc949f7570 (diff)
Don't fail on unicode errors when importing patches
Use backslashreplace not lose data.
-rw-r--r--gbp/patch_series.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gbp/patch_series.py b/gbp/patch_series.py
index 2f1638fa..ccb12fe8 100644
--- a/gbp/patch_series.py
+++ b/gbp/patch_series.py
@@ -74,7 +74,7 @@ class Patch(object):
header = rfc_header[:-1].lower()
self.info[header] = value.strip()
try:
- self.long_desc = "".join([l.decode() for l in body])
+ self.long_desc = "".join([l.decode("utf-8", "backslashreplace") for l in body])
except (IOError, UnicodeDecodeError) as msg:
raise GbpError("Failed to read patch header of '%s': %s" %
(self.path, msg))