[Zope-dev] some broken publishers on retry

Adam Groszer agroszer at gmail.com
Thu Jan 31 13:21:30 EST 2008


Hello,

After a day of debugging I came to the finding that at some places the
request and response gets faked after a retry occurred.

zope.app.testing.functional calls the publisher like this:
publish(request, handle_errors=handle_errors)
deep in publish a new instance of request is created in case of a retry
old one dropped, works on the new one
def publish(request, handle_errors=True):
...
return request
(returns the newly instantiated request)
back to zope.app.testing.functional:
publish(request, handle_errors=handle_errors)
it just drops the return value

I found the following likely places that could be affected:

zope.app.testing.functional
        response = ResponseWrapper(request.response, path)
        if env.has_key('HTTP_COOKIE'):
            self.loadCookies(env['HTTP_COOKIE'])
        publish(request, handle_errors=handle_errors)
        self.saveCookies(response)
...
        response = ResponseWrapper(request.response, path)
        publish(request, handle_errors=handle_errors)
        return response
        
zope.server.ftp.publisher.py:
         response = request.response
         publish(request)
         return response.getResult()

zope.app.twisted.ftp.utils.py:
        response = request.response
        publish(request)
        return response.getResult()
        
zope.app.debug.debug.py:
        request = self._request(path, stdin, *args, **kw)
        getStatus = getattr(request.response, 'getStatus', lambda: None)
        _publish(request

Anybody for/against fixing those?
        
-- 
Best regards,
 Adam Groszer                          mailto:agroszer at gmail.com
--
Quote of the day:
This dead of midnight is the noon of thought, And Wisdom mounts her zenith with the stars. 
- Lady Barbauld 



More information about the Zope-Dev mailing list