[Zope] error with simple python script loop

Chris Withers chris at simplistix.co.uk
Mon Nov 27 11:16:14 EST 2006


Christian Steinhauer wrote:
>>> http://www.blunck.se/iehttpheaders/iehttpheaders.html
>>>
> 
> What a nice tool. Now more debugging with some interesting results. 
> 
> ###
> for i in range(2):
>   context.MailHost.send('bodytext', "rec at mail.com", "sender at mail.com",
> 'subj'+str(i))
> ###
> This script produces: HTTP/1.1 204 No Content

Moral of the story: if you want sane things to happen, make sure your 
script returns a string output.

Otherwise you risk tickling some of the more arcane "features" of Zope 
2's publisher. They include "no content" responses if you return None 
and even weirder things if you return a two-element tuple.

This isn't a bug, you're doing something silly, stop doing it ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list