[Checkins] SVN: Products.GenericSetup/trunk/ More documentation

Patrick Gerken do3ccqrv at gmail.com
Wed Nov 23 15:55:18 UTC 2011


Log message for revision 123473:
  More documentation
  
  Add migration guide to changes.
  Add reference to changelist in new Exceptions.
  All related to enforcing reading and writing
  encoded strings instead of unicode objects.
  

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/context.py
  U   Products.GenericSetup/trunk/docs/CHANGES.rst

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/context.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/context.py	2011-11-21 20:30:01 UTC (rev 123472)
+++ Products.GenericSetup/trunk/Products/GenericSetup/context.py	2011-11-23 15:55:17 UTC (rev 123473)
@@ -313,7 +313,8 @@
         """
         if isinstance(text, unicode):
             raise ValueError("Unicode text is not supported, even if it only "
-                             "contains ascii. Please encode your data")
+                             "contains ascii. Please encode your data. See "
+                             "GS 1.7.0 changes for more")
         file = self.openDataFile( filename, content_type, subdir )
         file.write( text )
         file.close()
@@ -464,7 +465,8 @@
             info.size = len(text)
         elif isinstance(text, unicode):
             raise ValueError("Unicode text is not supported, even if it only "
-                             "contains ascii. Please encode your data")
+                             "contains ascii. Please encode your data. See "
+                             "GS 1.7.0 changes for more")
         else:
             # Assume text is a an instance of a class like
             # Products.Archetypes.WebDAVSupport.PdataStreamIterator, 
@@ -518,7 +520,8 @@
 
         if isinstance(text, unicode):
             raise ValueError("Unicode text is not supported, even if it only "
-                             "contains ascii. Please encode your data")
+                             "contains ascii. Please encode your data. See "
+                             "GS 1.7.0 changes for more")
 
         folder = self._ensureSnapshotsFolder( subdir )
 

Modified: Products.GenericSetup/trunk/docs/CHANGES.rst
===================================================================
--- Products.GenericSetup/trunk/docs/CHANGES.rst	2011-11-21 20:30:01 UTC (rev 123472)
+++ Products.GenericSetup/trunk/docs/CHANGES.rst	2011-11-23 15:55:17 UTC (rev 123473)
@@ -7,6 +7,11 @@
 - Exporters now explicitly only understand strings. The provided
   registry handlers encode and decode data automatically to and from
   utf-8. Their default encoding changed from None to utf-8.
+  If you have custom registry handlers, ensure that you encode your unicode.
+  Check especially if you use a page template to generate xml. They return
+  unicode and their output must also encoded.
+  If you choose to encode your strings with utf-8, you can be sure that
+  your code will also work with GenericSetup < 1.7
 
 
 1.6.4 (2011-10-31)



More information about the checkins mailing list