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

[PATCH] Modify blendstasktools.py to solve the UnicodeError in tasks.py



---
 webtools/blendstasktools.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index c58ef80..76cbfff 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
-- 
2.1.4


Reply to: