[Zope-Checkins] CVS: Zope/lib/python/DocumentTemplate - DT_Var.py:1.57.6.1

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 16 Sep 2002 06:10:26 -0400


Update of /cvs-repository/Zope/lib/python/DocumentTemplate
In directory cvs.zope.org:/tmp/cvs-serv22106

Modified Files:
      Tag: Zope-2_6-branch
	DT_Var.py 
Log Message:
merging toby-unicode-size-branch, a fix for a regression introduced by TaintedString changes, reported as collector #565

=== Zope/lib/python/DocumentTemplate/DT_Var.py 1.57 => 1.57.6.1 ===
--- Zope/lib/python/DocumentTemplate/DT_Var.py:1.57	Wed Aug 14 18:29:52 2002
+++ Zope/lib/python/DocumentTemplate/DT_Var.py	Mon Sep 16 06:10:25 2002
@@ -284,7 +284,7 @@
         if fmt=='s':
             # Keep tainted strings as tainted strings here.
             if not isinstance(val, TaintedString):
-                val=str(val)
+                val=ustr(val)
         else:
             # Keep tainted strings as tainted strings here.
             wastainted = 0
@@ -350,7 +350,7 @@
     # Unsafe data is explicitly quoted here; we don't expect this to be HTML
     # quoted later on anyway.
     if isinstance(v, TaintedString): v = v.quoted()
-    v=str(v)
+    v=ustr(v)
     if v.find('\r') >= 0: v=''.join(v.split('\r'))
     if v.find('\n') >= 0: v='<br />\n'.join(v.split('\n'))
     return v