[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/HTTP - HTTPResponse.py:1.3.2.2
Stephan Richter
srichter@cbu.edu
Fri, 14 Jun 2002 12:29:55 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/HTTP
In directory cvs.zope.org:/tmp/cvs-serv15385/lib/python/Zope/Publisher/HTTP
Modified Files:
Tag: srichter-z3-unicode-branch
HTTPResponse.py
Log Message:
Finally all tests pass. After a quick verification it is time to kill the
branch.
=== Zope3/lib/python/Zope/Publisher/HTTP/HTTPResponse.py 1.3.2.1 => 1.3.2.2 ===
import sys, re
-from types import StringType, UnicodeType, ClassType
+from types import StringTypes, UnicodeType, ClassType
from cgi import escape
from Zope.ComponentArchitecture import getAdapter
@@ -145,7 +145,7 @@
if status is None:
status = 200
else:
- if isinstance(status, StringType):
+ if type(status) in StringTypes:
status = status.lower()
if status in status_codes:
status = status_codes[status]
@@ -322,16 +322,16 @@
def internalError(self):
'See Zope.Publisher.IPublisherResponse.IPublisherResponse'
- self.setStatus(500, "The engines can't take any more, Jim!")
+ self.setStatus(500, u"The engines can't take any more, Jim!")
def _html(self, title, content):
t = escape(title)
return (
- "<html><head><title>%s</title></head>\n"
- "<body><h2>%s</h2>\n"
- "%s\n"
- "</body></html>\n" %
+ u"<html><head><title>%s</title></head>\n"
+ u"<body><h2>%s</h2>\n"
+ u"%s\n"
+ u"</body></html>\n" %
(t, t, content)
)