[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#787163: At the new package tracker the section bugs not shown



Hi,

> Since some day the section with the bugs are not more shown.

Tracker task UpdatePackageBugStats fails here on a few entries provided
by ddpo-bugs.cgi [1]:

  $ ./manage.py tracker_run_task UpdatePackageBugStats
  <snip>
  File "distro_tracker/vendor/debian/tracker_tasks.py", line 412
  UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 0:
  invalid start byte

The attached patch adds an exception for these entries.

Cheers,
Christophe

  1. https://udd.debian.org/cgi-bin/ddpo-bugs.cgi
From 63d65b4dfc35798ac84dbdffe3c1b59ce51de758 Mon Sep 17 00:00:00 2001
From: Christophe Siraut <d@tobald.eu.org>
Date: Mon, 1 Jun 2015 22:34:32 +0200
Subject: [PATCH] vendor/debian/tracker_tasks: add an exception for malformed
 ddpo-bugs entries

---
 distro_tracker/vendor/debian/tracker_tasks.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/distro_tracker/vendor/debian/tracker_tasks.py b/distro_tracker/vendor/debian/tracker_tasks.py
index 5b7b58b..cbb90b4 100644
--- a/distro_tracker/vendor/debian/tracker_tasks.py
+++ b/distro_tracker/vendor/debian/tracker_tasks.py
@@ -409,7 +409,11 @@ class UpdatePackageBugStats(BaseTask):
         # Each line in the response should be bug stats for a single package
         bug_stats = {}
         for line in response_content.splitlines():
-            line = line.decode('utf-8')
+            try:
+                line = line.decode('utf-8')
+            except Exception as e:
+                print e
+                continue
             package_name, bug_counts = line.split(':', 1)
             # Merged counts are in parentheses so remove those before splitting
             # the numbers
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature


Reply to: