[Python-Dev] cgi.py and huge uploads problem

Christian Tismer tismer@tismer.com
Mon, 06 Nov 2000 18:19:21 +0200


Howdy,

there is a problem with the cgi.py implementation of Python 1.5.2
and uploading of huge files.
(found out by Joachim Rudolph, Virtual Photonics)

Class FieldStorage of cgi.py has a couple of methods which
add accumulated lines to a self.lines array. This array fills and
fills until the whole upload is done, with the side effect of
loading the whole file into memory. The memory is freed
after the whole upload is done.

This is no problem, until a company like VPI uses cgi.py to
upload whole distributions of 100 MB and more, via Zope. :-)

Looking into cgi.py, I can't find a reason why this happens.
Is this possibly just a debugging feature which is no longer
needed?
While cgi.py was modified for cosmetic resons, I didn't find
changes for Python 2.0 on this topic.

Does it make sense to use a debug flag for this, or should
the feature vanish completely?
Do you want a patch?

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer@tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com