script returns nothing when value is false

Andreas Jung lists at zopyx.com
Tue Aug 28 13:56:59 UTC 2007



--On 28. August 2007 06:49:57 -0700 patrimith <paddysmith at gmail.com> wrote:
> When accessed via XMLRPC, a return value of True is received as True, but
> a return value of False results in a blank (i.e. no response).
>
> Any ideas why when a Script (Python) returns a value of False no response
> is sent?
>

Likely because the ZPublisher checks the response in a way like:

if result:
     spit_out_response()
else:
    do_nothing

And non-string content is converted using str() (I believe) before sending 
it back to the browser. This explains by True is returned as 'True'.

-aj
   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20070828/3e0a2d34/attachment.asc>


More information about the Product-Developers mailing list