[Zope3-checkins] SVN: Zope3/branches/3.3/ Merge from trunk:

Baiju M baiju.m.mail at gmail.com
Fri Oct 20 03:30:47 EDT 2006


Log message for revision 70836:
  Merge from trunk:
   Log message for revision 70828:
    Fixed encoding of newlines, carriage returns, and tabs when
    encoding attributes for widgets so we're consistent under all
    Python 2.4.x versions (including 2.4.4, which failed tests before).
  

Changed:
  U   Zope3/branches/3.3/doc/CHANGES.txt
  U   Zope3/branches/3.3/src/zope/app/form/browser/textwidgets.py
  U   Zope3/branches/3.3/src/zope/app/form/browser/widget.py
  U   Zope3/branches/3.3/src/zope/app/rotterdam/editingwidgets.py

-=-
Modified: Zope3/branches/3.3/doc/CHANGES.txt
===================================================================
--- Zope3/branches/3.3/doc/CHANGES.txt	2006-10-20 07:29:35 UTC (rev 70835)
+++ Zope3/branches/3.3/doc/CHANGES.txt	2006-10-20 07:30:46 UTC (rev 70836)
@@ -10,6 +10,10 @@
 
     Bugfixes
 
+      - Fixed encoding of newlines, carriage returns, and tabs when
+        encoding attributes for widgets so we're consistent under all
+        Python 2.4.x versions (including 2.4.4, which failed tests before).
+
       - Fixed issue 535: make HTTPInputStream work with Python 2.4.4.
 
       - Improved fix for issue 599: Made sure i18n Message based Invalid

Modified: Zope3/branches/3.3/src/zope/app/form/browser/textwidgets.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/form/browser/textwidgets.py	2006-10-20 07:29:35 UTC (rev 70835)
+++ Zope3/branches/3.3/src/zope/app/form/browser/textwidgets.py	2006-10-20 07:30:46 UTC (rev 70836)
@@ -256,8 +256,7 @@
       id="field.foo"
       name="field.foo"
       type="hidden"
-      value="Hello\r
-    world!"
+      value="Hello
world!"
       />
 
     Calling `setRenderedValue` will change what gets output:

Modified: Zope3/branches/3.3/src/zope/app/form/browser/widget.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/form/browser/widget.py	2006-10-20 07:29:35 UTC (rev 70835)
+++ Zope3/branches/3.3/src/zope/app/form/browser/widget.py	2006-10-20 07:30:46 UTC (rev 70836)
@@ -34,6 +34,15 @@
 
 import warnings
 
+
+if quoteattr("\r") != '"&13;"':
+    _quoteattr = quoteattr
+
+    def quoteattr(data):
+        return _quoteattr(
+            data, {'\n': '
', '\r': '
', '\t':'	'})
+
+
 class BrowserWidget(Widget, BrowserView):
     """Base class for browser widgets.
 

Modified: Zope3/branches/3.3/src/zope/app/rotterdam/editingwidgets.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/rotterdam/editingwidgets.py	2006-10-20 07:29:35 UTC (rev 70835)
+++ Zope3/branches/3.3/src/zope/app/rotterdam/editingwidgets.py	2006-10-20 07:30:46 UTC (rev 70836)
@@ -56,8 +56,7 @@
       id="field.foo"
       name="field.foo"
       type="hidden"
-      value="Hello\r
-    world!"
+      value="Hello
world!"
       />
 
     Calling `setRenderedValue` will change what gets output:



More information about the Zope3-Checkins mailing list