[Zope3-checkins] CVS: Zope3/src/zope/pagetemplate - pagetemplate.py:1.10

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Mar 19 18:35:34 EST 2004


Update of /cvs-repository/Zope3/src/zope/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv12392/src/zope/pagetemplate

Modified Files:
	pagetemplate.py 
Log Message:
Fixed issue 154. TTW ZPT code is now stored as unicode. 


=== Zope3/src/zope/pagetemplate/pagetemplate.py 1.9 => 1.10 ===
--- Zope3/src/zope/pagetemplate/pagetemplate.py:1.9	Wed Jun  4 05:09:45 2003
+++ Zope3/src/zope/pagetemplate/pagetemplate.py	Fri Mar 19 18:35:03 2004
@@ -128,7 +128,11 @@
         return self._v_warnings
 
     def write(self, text):
-        assert isinstance(text, str)
+        # We accept both, since the text can either come from a file (and the
+        # parser will take are of the encoding or from a TTW template, in
+        # which case we have already unicode. 
+        assert isinstance(text, (str, unicode))
+
         if text.startswith(self._error_start):
             errend = text.find('-->')
             if errend >= 0:




More information about the Zope3-Checkins mailing list