Files
cpython/Lib
Guido van Rossum 52b8c29ca7 Solve SF bug #231249: cgi.py opens too many (temporary) files.
class FieldStorage: this patch changes read_lines() and co. to use a
StringIO() instead of a real file.  The write() calls are redirected
to a private method that replaces it with a real, external file only
when it gets too big (> 1000 bytes).

This avoids problems in forms using the multipart/form-data encoding
with many fields.  The original code created a temporary file for
*every* field (not just for file upload fields), thereby sometimes
exceeding the open file limit of some systems.

Note that the simpler solution "use a real file only for file uploads"
can't be used because the form field parser has no way to tell which
fields correspond to file uploads.

It's *possible* but extremely unlikely that this would break someone's
code; they would have to be stepping way outside the documented
interface for FieldStorage and use f.file.fileno(), or depend on
overriding make_file() to return a file-like object with additional
known properties.
2001-06-29 13:06:06 +00:00
..
2001-06-09 09:26:21 +00:00
2001-06-25 07:23:57 +00:00
2001-06-17 07:05:43 +00:00
2001-04-08 07:23:44 +00:00
2001-06-07 18:56:13 +00:00
2001-02-09 05:38:46 +00:00
2001-02-10 00:06:00 +00:00
2001-02-18 03:30:53 +00:00
2001-05-29 06:06:54 +00:00
2001-03-16 08:29:48 +00:00
2001-01-20 23:34:12 +00:00
2001-01-20 23:34:12 +00:00
2001-01-20 23:34:12 +00:00
2001-01-20 23:34:12 +00:00
2001-01-20 23:34:12 +00:00
2001-01-23 15:35:05 +00:00
2001-02-09 10:10:02 +00:00
2001-06-01 16:25:38 +00:00
2001-02-09 10:18:37 +00:00
2001-01-24 06:27:27 +00:00
2001-06-19 00:26:25 +00:00
2001-02-09 09:48:45 +00:00
2001-05-29 04:27:01 +00:00
2001-01-24 06:27:27 +00:00
2001-02-09 09:48:45 +00:00
2001-02-10 00:22:33 +00:00
2001-02-09 09:39:08 +00:00
2001-04-10 15:42:02 +00:00
2001-02-18 03:30:53 +00:00
2001-02-09 07:02:17 +00:00
2001-02-09 20:06:00 +00:00
2001-02-12 02:00:42 +00:00
2001-06-07 05:49:05 +00:00
2001-05-29 06:06:54 +00:00
2001-02-12 02:00:42 +00:00
2001-02-12 02:00:42 +00:00
2001-02-18 03:30:53 +00:00
2001-02-15 23:56:39 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 23:56:39 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-02-15 22:15:14 +00:00
2001-03-29 04:36:09 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-03-22 15:50:10 +00:00
2001-02-18 03:30:53 +00:00
2001-02-15 22:15:14 +00:00
2001-02-18 03:30:53 +00:00
2001-01-15 01:36:40 +00:00
2001-01-15 01:36:40 +00:00
2000-08-24 21:08:39 +00:00
2001-02-10 00:22:33 +00:00
2001-03-16 08:29:48 +00:00
2001-05-11 19:52:57 +00:00