[Zope-Checkins] CVS: Zope/lib/python/ZServer - FCGIServer.py:1.24 HTTPResponse.py:1.44 PCGIServer.py:1.29

Tres Seaver tseaver at zope.com
Thu Jan 15 18:03:29 EST 2004


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

Modified Files:
	FCGIServer.py HTTPResponse.py PCGIServer.py 
Log Message:


  - Don't allow Unicode strings to be passed to response.write() (merged
    from 2.6 / 2.7 audit).


=== Zope/lib/python/ZServer/FCGIServer.py 1.23 => 1.24 ===
--- Zope/lib/python/ZServer/FCGIServer.py:1.23	Sun Dec 14 22:11:25 2003
+++ Zope/lib/python/ZServer/FCGIServer.py	Thu Jan 15 18:02:58 2004
@@ -669,6 +669,10 @@
         self.channel = channel
 
     def write(self, data):
+
+        if type(data) != type(''):
+            raise TypeError('Value must be a string')
+
         stdout=self.stdout
 
         if not self._wrote:


=== Zope/lib/python/ZServer/HTTPResponse.py 1.43 => 1.44 ===
--- Zope/lib/python/ZServer/HTTPResponse.py:1.43	Tue Mar 18 16:15:14 2003
+++ Zope/lib/python/ZServer/HTTPResponse.py	Thu Jan 15 18:02:58 2004
@@ -151,6 +151,10 @@
         after beginning stream-oriented output.
 
         """
+
+        if type(data) != type(''):
+            raise TypeError('Value must be a string')
+
         stdout=self.stdout
 
         if not self._wrote:


=== Zope/lib/python/ZServer/PCGIServer.py 1.28 => 1.29 ===
--- Zope/lib/python/ZServer/PCGIServer.py:1.28	Sun Dec 14 22:11:25 2003
+++ Zope/lib/python/ZServer/PCGIServer.py	Thu Jan 15 18:02:58 2004
@@ -341,6 +341,9 @@
 class PCGIResponse(HTTPResponse):
 
     def write(self, data):
+        if type(data) != type(''):
+            raise TypeError('Value must be a string')
+
         if not self._wrote:
             self.stdout.write(str(self))
             self._wrote=1




More information about the Zope-Checkins mailing list