Skip to content

Request.post() stores data in temp files #1469

Closed
@popravich

Description

Long story short

web_reqrep.Request.post() reads whole payload into memory and than stores uploads into temp files — implicitly by using cgi.FieldStorage.

Expected behaviour

Either no temporary files or explicit behavior.

Actual behaviour

cgi.FieldStorage creates temporary file for each upload (file).
The FieldStorage docstring states the following:

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

So it is possible to control how uploads are handled — either stored into temp files or any other way...

PS: python documentation is missing FieldStorage description.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions