[mod_python] "0" added after content, magically

Alex Greif alex.greif at gmail.com
Fri Aug 4 17:39:14 EDT 2006

you are right, if I write:
return "some html code"
then the "0" does not appear.

But I am a confused, in the mod_python manual there are many samples like:
from mod_python import apache
  def handler(req):
    req.content_type = 'text/plain'
    req.write("Hello World!")
    return apache.OK

When do I return apache.OK and when do I return a string?
What is needed in which situation?


On 8/4/06, Robert Brewer <fumanchu at amor.org> wrote:
> Alex Greif wrote:
>  > the strange phenomenon is that something appends a "0"
>  > after my html output. This happens on Unix and also on
>  > Windows. Any Ideas ?
>  One idea: apache.OK == 0. Perhaps you're supposed to return data instead of
> writing data and then returning a status?
>  Robert Brewer
>  System Architect
>  Amor Ministries
>  fumanchu at amor.org

More information about the Mod_python mailing list