[Blends-commit] [SCM] website branch, master, updated. 4a11dea732797c30ad9e68aa60d5fe7c21f45c6a

Andreas Tille tille at debian.org
Sun Mar 22 07:50:20 UTC 2015


The following commit has been merged in the master branch:
commit 4a11dea732797c30ad9e68aa60d5fe7c21f45c6a
Author: Akshita Jha <zenith158 at gmail.com>
Date:   Sun Mar 22 01:54:03 2015 +0530

    Modify blendstasktools.py to solve the UnicodeError in tasks.py The error was due to characters present in the 'long description' of some dependencies in the 'unofficial' and 'prospective' packages. Also, there were some 'authors' names in the dependencies of 'wnpp' package that had the same issue. I wrote a try-except block in blendstasktools.py which encodes these characters for 'xhtml' rendering.

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index c58ef80..4d288f6 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -1201,6 +1201,21 @@ class TaskDependencies:
         if dep.dep_strength == 'Ignore' or dep.dep_strength == 'Avoid':
             return
         if source != 1:
+
+	    # Solves UnicodeEncodeError because of characters present in the
+            # long description of the dependecies in 'unoficial','prospective' packages
+            try:
+              dep.desc['en']['long'] = dep.desc['en']['long'].encode('ascii','xmlcharrefreplace')
+            except:
+              pass
+
+            # Solves UnicodeEncodeError because of characters present in the
+            # authors name of the dependencies in 'wnpp' packages
+	    try:
+              dep.properties['published']['authors'] = dep.properties['published']['authors'].encode('ascii','xmlcharrefreplace')
+            except:
+              pass
+
             # In general we can just add the dependency to the list
             self.dependencies[dep.pkgstatus].append(dep)
             return

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list