[issue10879] cgi memory usage

Glenn Linderman report at bugs.python.org
Mon Jan 10 21:17:20 CET 2011


Glenn Linderman <v+python at g.nevcal.com> added the comment:

R. David said:
However, I'm not clear on how that helps.  Doesn't FieldStorage also load everything into memory?

I say:
FieldStorage in 2.x (for x <= 6, at least) copies incoming file data to a file, using limited size read/write operations.  Non-file data is buffered in memory.

In 3.x, FieldStorage doesn't work.  The code that is there, though, for multipart/ data, would call email to do all the parsing, which would happen to include file data, which always comes in as part of a multipart/ data stream.  This would prevent cgi from being used to accept large files in a limited environment.  Sadly, there is code is place that would the copy the memory buffers to files, and act like they were buffered... but process limits do not care that the memory usage is only temporary...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10879>
_______________________________________


More information about the Python-bugs-list mailing list