[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-84-g7f1be3f

Sandro Tosi morph at debian.org
Sat Apr 3 14:14:13 UTC 2010


The following commit has been merged in the master branch:
commit 7f1be3fd08a632e5fc217ef2b9aaf8370065e144
Author: Sandro Tosi <morph at debian.org>
Date:   Sat Apr 3 16:12:46 2010 +0200

    encode bug summary lines to avoid crashed when using urwid UI due to unparsable UTF8 characters; thanks to Stefan Seide for the report; Closes: #552045
    
    This is similar to what it's done in text ui (but there we also remove te
    [*|*|*] stuff) where we encode the summary line before printing it.

diff --git a/debian/changelog b/debian/changelog
index 2649307..761e45b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,8 +27,12 @@ reportbug (4.12) UNRELEASED; urgency=low
     - added information about new --timeout CLI option, specifying that some
       network error might be due to a too low timeout; thanks to Michal Suchanek
       for the report; Closes: #571955
+  * reportbug/ui/urwid_ui.py
+    - encode bug summary lines to avoid crashed when using urwid UI due to
+      unparsable UTF8 characters; thanks to Stefan Seide for the report;
+      Closes: #552045
 
- -- Sandro Tosi <morph at debian.org>  Thu, 01 Apr 2010 23:56:02 +0200
+ -- Sandro Tosi <morph at debian.org>  Sat, 03 Apr 2010 16:10:02 +0200
 
 reportbug (4.11) unstable; urgency=low
 
diff --git a/reportbug/ui/urwid_ui.py b/reportbug/ui/urwid_ui.py
index 8f5e32f..baa94ee 100644
--- a/reportbug/ui/urwid_ui.py
+++ b/reportbug/ui/urwid_ui.py
@@ -582,6 +582,9 @@ def handle_bts_query(package, bts, timeout, mirrors=None, http_proxy="",
                 bcount = len(bugs)
                 buglist.append( ('---', t) )
                 for bug in bugs:
+                    # encode the bug summary line, to avoid crashes due to
+                    # unparsable UTF8 characters
+                    bug = bug.encode('us-ascii', 'replace')
                     bits = re.split(r'[: ]', bug[1:], 1)
                     if len(bits) > 1:
                         tag, info = bits

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list