[Commits] (morgen) Convert any unicode to ascii before handing it to twisted

commits at osafoundation.org commits at osafoundation.org
Thu Apr 14 23:47:06 PDT 2005


Commit by: morgen
Modified files:
chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py 1.17 1.18

Log message:
Convert any unicode to ascii before handing it to twisted


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py.diff?r1=text&tr1=1.17&r2=text&tr2=1.18

Index: chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py
diff -u chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py:1.17 chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py:1.18
--- chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py:1.17	Wed Mar 30 16:36:21 2005
+++ chandler/parcels/osaf/framework/webserver/servlets/repo/Repo.py	Thu Apr 14 23:47:05 2005
@@ -108,12 +108,16 @@
                     result += RenderAllClouds(repoView)
 
             finally: # inner try
-                prevView.setCurrentView()
+                if prevView:
+                    prevView.setCurrentView()
 
         except Exception, e: # outer try
             result = "<html>Caught an exception: %s<br> %s</html>" % (e, "<br>".join(traceback.format_tb(sys.exc_traceback)))
 
-        return str(result)
+        if isinstance(result, unicode):
+            result = result.encode('ascii', 'replace')
+            
+        return result
 
 
 def RenderSearchForm(repoView):



More information about the Commits mailing list