[Blends-commit] [SCM] website branch, master, updated. 8938375f79698aa9507a6e214ff62ad2cd0afbcc

Ole Streicher olebole at debian.org
Mon Mar 7 08:00:05 UTC 2016


The following commit has been merged in the master branch:
commit 8938375f79698aa9507a6e214ff62ad2cd0afbcc
Author: Ole Streicher <olebole at debian.org>
Date:   Mon Mar 7 08:59:57 2016 +0100

    Try reading of tasks files with iso.8859 instead of utf-8 due to #817018

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 049ad3e..2b8a388 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -895,7 +895,7 @@ class Tasks:
         # The prefix is used to build the meta package name that belongs to the task
         cmd = "cd %s; %s metapackageprefix" % (self.data['datadir'], blend_get_names)
         pipe = Popen(cmd, shell=True, stdout=PIPE).stdout
-        prefix = pipe.read().strip() + '-'
+        prefix = pipe.read().decode('utf-8').strip() + '-'
         pipe.close()
 
         metapackages = []
@@ -1199,9 +1199,16 @@ class TaskDependencies:
     def GetTaskDependencies(self, source=0):
         global dep_strength_keys
 
-        f = codecs.open(self.taskfile, "r", "utf-8")
         found_description=False
-        for stanza in deb822.Sources.iter_paragraphs(f):
+        try:
+            f = codecs.open(self.taskfile, "r", "utf-8")
+            iter = deb822.Sources.iter_paragraphs(f)
+        except UnicodeDecodeError:
+            # debian-edu still has some tasks files in non-utf-8
+            # bug #817018
+            f = codecs.open(self.taskfile, "r", "iso-8859-1")
+            iter = deb822.Sources.iter_paragraphs(f, encoding="iso-8859-1")
+        for stanza in iter:
             # Why and Responsible can be valid for more than one dependency
             # Store them in strings and use them for all Dependent Package objects
             why               = None

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list