Re: problem with input filter and POST data (fileupload)

Graham Dumpleton <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
2009/2/15 Graham Dumpleton <[email protected]>:
> Bouncing replay back to list.
>
> 2009/2/15 Joerg <[email protected]>:
>>> 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.

Graham
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.