This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author akuchling
Recipients
Date 2001-02-18.22:08:02
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Ah, I see; the traceback makes this much clearer.  When you're uploading a file, everything in the form is sent as 
a MIME document in the body; every field is accompanied by 
a boundary separator and Content-Disposition header.
In multipart mode, cgi.py copies each field into a temporary file.  

The first idea I had was to only use tempfiles for the actual upload field; unfortunately, that doesn't help because the upload field isn't special, and cgi.py has no way to know which it is ahead of time.

Possible second approach: measure the size of the resulting file; if it's less than some threshold (1K? 10K?), read its contents into memory and close the tempfile.  This means only the largest fields will require that a file descriptor be kept open.  I'll explore this more after beta1.


History
Date User Action Args
2007-08-23 13:53:03adminlinkissue231249 messages
2007-08-23 13:53:03admincreate