[Zope3-checkins] CVS: Zope3/src/zope/publisher - base.py:1.5 browser.py:1.17 http.py:1.23
Viktorija Zaksiene
ryzaja@codeworks.lt
Fri, 25 Apr 2003 06:37:09 -0400
Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv11283
Modified Files:
base.py browser.py http.py
Log Message:
Reset response state on exception views.
=== Zope3/src/zope/publisher/base.py 1.4 => 1.5 ===
--- Zope3/src/zope/publisher/base.py:1.4 Mon Feb 3 10:00:49 2003
+++ Zope3/src/zope/publisher/base.py Fri Apr 25 06:36:38 2003
@@ -59,6 +59,10 @@
'Returns a string representing the currently set body.'
return self._body
+ def reset(self):
+ 'See IPublisherResponse'
+ self._body = ""
+
def handleException(self, exc_info):
'See IPublisherResponse'
traceback.print_exception(
@@ -468,6 +472,7 @@
def handleException(self, object, request, exc_info, retry_allowed=1):
# Let the response handle it as best it can.
+ request.response.reset()
request.response.handleException(exc_info)
=== Zope3/src/zope/publisher/browser.py 1.16 => 1.17 ===
--- Zope3/src/zope/publisher/browser.py:1.16 Wed Apr 16 02:57:49 2003
+++ Zope3/src/zope/publisher/browser.py Fri Apr 25 06:36:38 2003
@@ -822,6 +822,10 @@
super(BrowserResponse, self).redirect(location, status)
+ def reset(self):
+ super(BrowserResponse, self).reset()
+ self._base = ''
+
class BrowserLanguages:
=== Zope3/src/zope/publisher/http.py 1.22 => 1.23 ===
--- Zope3/src/zope/publisher/http.py:1.22 Thu Apr 17 04:52:57 2003
+++ Zope3/src/zope/publisher/http.py Fri Apr 25 06:36:38 2003
@@ -605,6 +605,11 @@
self._header_output = header_output
super(HTTPResponse, self).__init__(outstream)
+ self.reset()
+
+ def reset(self):
+ 'See IResponse'
+ super(HTTPResponse, self).reset()
self._headers = {}
self._cookies = {}
self._accumulated_headers = []
@@ -614,7 +619,6 @@
self._reason = 'No status set'
self._status_set = False
self._charset = None
-
def setHeaderOutput(self, header_output):
self._header_output = header_output