Thanks, that looks right to me.  Applied in trunk.

Jakub Stolarski wrote:
> On 11 Lut, 12:41, Jakub Stolarski <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I have to upload huge files (up to 200MB) through Pylons and save it
>> on disk. When I read request.params.keys memory consumption raises up
>> to 250MB with 100MB uploaded file (then it generally falls). Is there
>> any method to keep memory usage low?
>>
>> Python 2.4/2.5
>> Pylons 0.9.6.1
>> Run with egg:Paste#http
>>
>> Thanks in advance
> 
> I think I have found a problem. In paste.httpserver
> LimitedLengthFile.readline does not use 'size' parameter, which is
> used in cgi.FieldStorage. Here is a patch (aginst trunk). It would be
> nice if someone could confirm that bug.
> 
> 
> --- httpserver.py.old Mon Feb 11 16:18:42 2008
> +++ httpserver.py     Mon Feb 11 16:19:37 2008
> @@ -464,7 +464,10 @@
>          return data
> 
>      def readline(self, *args):
> -        data = self.file.readline(self.length - self._consumed)
> +        max_read = self.length - self._consumed
> +        if len(args):
> +            max_read = min(args[0], max_read
> +        data = self.file.readline(max_read)
>          self._consumed += len(data)
>          return data
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to