[issue9968] cgi.FieldStorage: Give control about the directory used for uploads

Éric Araujo report at bugs.python.org
Sat Jul 30 15:45:20 CEST 2011


Éric Araujo <merwok at netwok.org> added the comment:

> After pondering this for a while I think the simpler is the better
> and I propose to add documentation to inform the reader that changing
> the temp directory through os.environ of tempfile.tempdir might worth
> consideration.
Okay.  Your patch has this doc change and also code changes.

I’ve read in the tempfile module docstring that in order to control the directory, you have to set tempfile.tempdir before calling any tempfile function.  I suspect this will not be okay for some applications.  I wonder if the same limitation applies when one sets os.environ['TMP'].

In the light of that, do you think the tempfile solution is enough, or do you want to get back to the earlier idea of adding an argument to FieldStorage?

(One advantage of doc changes is that they can get committed to 2.7, 3.2 and 3.3 and get published immediately.  We can anyway make a code change in 3.3 and a doc change for older versions.)

> As for other use cases for changing the temp directory, I thought
> about letting the user choose the FS of its choice with regard to
> performance or security (crypted FS) or even having the temp files
> created in a directory with 700 permissions.
Excellent use cases.

> I fiddled last night with setting an environment to deploy and test a
> patched Python
Are you aware of the developers’ guide?  http://docs.python.org/devguide/

> (I had some problem to understand what happened when I encountered
> 6755).
What is 6755?

----------
title: Let cgi.FieldStorage have named uploaded file -> cgi.FieldStorage: Give control about the directory used for uploads

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


More information about the Python-bugs-list mailing list