[Zope-Checkins] SVN: Zope/trunk/ - made sure getConfiguration().default_zpublisher_encoding is set correctly

Yvo Schubbe y.2011 at wcm-solutions.de
Fri Mar 4 12:06:29 EST 2011


Log message for revision 120748:
  - made sure getConfiguration().default_zpublisher_encoding is set correctly
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  UU  Zope/trunk/src/Zope2/Startup/datatypes.py
  UU  Zope/trunk/src/Zope2/Startup/tests/test_schema.py
  U   Zope/trunk/src/Zope2/Startup/zopeschema.xml

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2011-03-04 16:55:25 UTC (rev 120747)
+++ Zope/trunk/doc/CHANGES.rst	2011-03-04 17:06:29 UTC (rev 120748)
@@ -10,7 +10,9 @@
 
 Bugs Fixed
 ++++++++++
- 
+
+- Made sure getConfiguration().default_zpublisher_encoding is set correctly.
+
 - LP #713253: Prevent publication of acquired attributes, where the acquired
   object does not have a docstring.
 

Modified: Zope/trunk/src/Zope2/Startup/datatypes.py
===================================================================
--- Zope/trunk/src/Zope2/Startup/datatypes.py	2011-03-04 16:55:25 UTC (rev 120747)
+++ Zope/trunk/src/Zope2/Startup/datatypes.py	2011-03-04 17:06:29 UTC (rev 120748)
@@ -11,7 +11,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-
 """Datatypes for the Zope schema for use with ZConfig."""
 
 import os
@@ -228,7 +227,7 @@
                     container_class = 'OFS.Folder.Folder'
                 return (real_root, real_path, container_class)
         raise LookupError('Nothing known about mount path %s' % mount_path)
-    
+
 def default_zpublisher_encoding(value):
     # This is a bit clunky but necessary :-(
     # These modules are imported during the configuration process
@@ -239,6 +238,7 @@
     Converters.default_encoding = value
     HTTPRequest.default_encoding = value
     HTTPResponse.default_encoding = value
+    return value
 
 class DBTab:
     """A Zope database configuration, similar in purpose to /etc/fstab.


Property changes on: Zope/trunk/src/Zope2/Startup/datatypes.py
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
   - 1.18

Modified: Zope/trunk/src/Zope2/Startup/tests/test_schema.py
===================================================================
--- Zope/trunk/src/Zope2/Startup/tests/test_schema.py	2011-03-04 16:55:25 UTC (rev 120747)
+++ Zope/trunk/src/Zope2/Startup/tests/test_schema.py	2011-03-04 17:06:29 UTC (rev 120748)
@@ -11,7 +11,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-
 """Test that the Zope schema can be loaded."""
 
 import os
@@ -221,5 +220,18 @@
             """)
         self.assertEqual(conf.max_conflict_retries, 15)
 
+    def test_default_zpublisher_encoding(self):
+        conf, dummy = self.load_config_text("""\
+            instancehome <<INSTANCE_HOME>>
+            """)
+        self.assertEqual(conf.default_zpublisher_encoding, 'iso-8859-15')
+
+        conf, dummy = self.load_config_text("""\
+            instancehome <<INSTANCE_HOME>>
+            default-zpublisher-encoding utf-8
+            """)
+        self.assertEqual(conf.default_zpublisher_encoding, 'utf-8')
+
+
 def test_suite():
     return unittest.makeSuite(StartupTestCase)


Property changes on: Zope/trunk/src/Zope2/Startup/tests/test_schema.py
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
   - 1.10

Modified: Zope/trunk/src/Zope2/Startup/zopeschema.xml
===================================================================
--- Zope/trunk/src/Zope2/Startup/zopeschema.xml	2011-03-04 16:55:25 UTC (rev 120747)
+++ Zope/trunk/src/Zope2/Startup/zopeschema.xml	2011-03-04 17:06:29 UTC (rev 120748)
@@ -877,12 +877,13 @@
 
   <section type="zoperunner" name="*" attribute="runner"/>
 
-  <key name="default-zpublisher-encoding" datatype=".default_zpublisher_encoding">
+  <key name="default-zpublisher-encoding"
+       datatype=".default_zpublisher_encoding"
+       default="iso-8859-15">
      <description>
        This key controls what character set is used to encode unicode
        data that reaches ZPublisher without any other specified encoding.
      </description>
-     <metadefault>iso-8859-15</metadefault>
   </key>
 
   <abstracttype name="zope.product.base">



More information about the Zope-Checkins mailing list