[Python-modules-commits] [python-fastimport] 01/01: Add patch from upstream to fix a crash with UTF-8 encoded author names

Mattia Rizzolo mattia at debian.org
Sun Apr 23 06:45:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository python-fastimport.

commit dc1a31a6948708463e288a6e83b5047c1af4b5d5
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sun Apr 23 08:41:43 2017 +0200

    Add patch from upstream to fix a crash with UTF-8 encoded author names
    
    LP: #1647101
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 debian/changelog                                   |  8 ++++++++
 ...ope_with_bytestrings_in_utf8_bytes_string.patch | 24 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 33 insertions(+)

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 at 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 at jelmer.uk>
+Acked-By: Unit 193 <unit193 at ubuntu.com>
+Acked-By: Mattia Rizzolo <mattia at 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-fastimport.git



More information about the Python-modules-commits mailing list