[mod_python] problem with input filter and POST data (fileupload)

Graham Dumpleton graham.dumpleton at gmail.com
Sun Feb 15 16:05:46 EST 2009

2009/2/15 Graham Dumpleton <graham.dumpleton at gmail.com>:
> Bouncing replay back to list.
> 2009/2/15 Joerg <jerch at rockborn.de>:
>>> Behaviour explained through failing to check for 'None' on data read
>>> by input filter before closing it.
>>>   from mod_python import apache
>>>   def outputfilter(filter):
>>>       s = filter.read()
>>>       while s:
>>>           filter.write(s.upper())
>>>           s = filter.read()
>>>       if s is None:
>>>           filter.close()
>>> In other words, forget the 'if s is None' and you will see that occur
>>> as input filter has been prematurely closed.
>>> Graham
>> sorry graham, it doesnt work with the "if s is None" either.

Augment your input filter script with debug statements so you can
trace exactly what it is doing, ie., data read, accumulated length of
data etc etc.

Use apache.log_error() function to do this.

Post your results, analysis and code used.

I still don't believe modifying util.py is the answer, it is more
likely to be something in your input filter not passing everything
back or truncating it.


More information about the Mod_python mailing list