diff options
author | Mattia Rizzolo <mattia@debian.org> | 2017-04-23 08:41:43 +0200 |
---|---|---|
committer | Mattia Rizzolo <mattia@debian.org> | 2017-04-23 08:42:58 +0200 |
commit | dc1a31a6948708463e288a6e83b5047c1af4b5d5 (patch) | |
tree | 4d1fca1e5608e0d52e6a871d1e490558f29f475a | |
parent | 41993dc79b09a0a684ed82011a99cb648b7864f6 (diff) | |
download | python-fastimport-git-dc1a31a6948708463e288a6e83b5047c1af4b5d5.tar.gz |
Add patch from upstream to fix a crash with UTF-8 encoded author namesdebian/0.9.6-3
LP: #1647101
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/patches/Cope_with_bytestrings_in_utf8_bytes_string.patch | 24 | ||||
-rw-r--r-- | debian/patches/series | 1 |
3 files changed, 33 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 9c9f510..b31b981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-fastimport (0.9.6-3) unstable; urgency=medium + + * Team upload. + * Add patch from upstream to fix a crash with UTF-8 encoded author names. + LP: #1647101 + + -- Mattia Rizzolo <mattia@debian.org> Sun, 23 Apr 2017 08:40:09 +0200 + python-fastimport (0.9.6-2) unstable; urgency=medium * Only mark as breaking older versions of bzr-fastimport << diff --git a/debian/patches/Cope_with_bytestrings_in_utf8_bytes_string.patch b/debian/patches/Cope_with_bytestrings_in_utf8_bytes_string.patch new file mode 100644 index 0000000..efedb57 --- /dev/null +++ b/debian/patches/Cope_with_bytestrings_in_utf8_bytes_string.patch @@ -0,0 +1,24 @@ +Description: Cope with bytestrings in utf8_bytes_string() helper. +Author: Jelmer Vernooij <jelmer@jelmer.uk> +Acked-By: Unit 193 <unit193@ubuntu.com> +Acked-By: Mattia Rizzolo <mattia@debian.org> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1647101 +Last-Update: 2017-04-23 + +--- a/fastimport/helpers.py ++++ b/fastimport/helpers.py +@@ -99,9 +99,12 @@ + + + def utf8_bytes_string(s): +- """Convert a string to a bytes string encoded in utf8""" ++ """Convert a string to a bytes string (if necessary, encode in utf8)""" + if sys.version_info[0] == 2: +- return s.encode('utf8') ++ if isinstance(s, str): ++ return s ++ else: ++ return s.encode('utf8') + else: + if isinstance(s, str): + return bytes(s, encoding='utf8') diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..53d2ca8 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +Cope_with_bytestrings_in_utf8_bytes_string.patch |