[ZPT] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.69.4.1

Chris McDonough chrism@zope.com
Tue, 10 Sep 2002 23:37:08 -0400


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

Modified Files:
      Tag: chrism-install-branch
	TALInterpreter.py 
Log Message:
Merging chrism-install-branch with HEAD changes.


=== Zope/lib/python/TAL/TALInterpreter.py 1.69 => 1.69.4.1 ===
--- Zope/lib/python/TAL/TALInterpreter.py:1.69	Wed Aug 14 17:58:54 2002
+++ Zope/lib/python/TAL/TALInterpreter.py	Tue Sep 10 23:36:37 2002
@@ -114,6 +114,11 @@
         self.scopeLevel = 0
         self.sourceFile = None
 
+    def StringIO(self):
+        # Third-party products wishing to provide a full Unicode-aware
+        # StringIO can do so by monkey-patching this method.
+        return StringIO()
+
     def saveState(self):
         return (self.position, self.col, self.stream,
                 self.scopeLevel, self.level)
@@ -319,7 +324,7 @@
 
     def no_tag(self, start, program):
         state = self.saveState()
-        self.stream = stream = StringIO()
+        self.stream = stream = self.StringIO()
         self._stream_write = stream.write
         self.interpret(start)
         self.restoreOutputState(state)
@@ -565,7 +570,7 @@
 
     def do_onError_tal(self, (block, handler)):
         state = self.saveState()
-        self.stream = stream = StringIO()
+        self.stream = stream = self.StringIO()
         self._stream_write = stream.write
         try:
             self.interpret(block)