[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/utils.py If exported value is None, attribute value is empty string (fixes a crash on contentrules configuration export)

Thomas Desvenain thomas.desvenain at gmail.com
Wed Mar 23 11:33:53 EDT 2011


Log message for revision 121096:
  If exported value is None, attribute value is empty string (fixes a crash on contentrules configuration export)

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/utils.py

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/utils.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/utils.py	2011-03-23 15:23:20 UTC (rev 121095)
+++ Products.GenericSetup/trunk/Products/GenericSetup/utils.py	2011-03-23 15:33:52 UTC (rev 121096)
@@ -350,7 +350,12 @@
 
         for a_name in a_names:
             wrapper.write()
-            a_value = escape(attrs[a_name].value.encode('utf-8'), quote=True)
+            a_value = attrs[a_name].value
+            if a_value is None:
+                a_value = ""
+            else:
+                a_value = escape(a_value.encode('utf-8'), quote=True))
+
             wrapper.queue(' %s="%s"' % (a_name, a_value))
 
         if self.childNodes:



More information about the checkins mailing list