cgi.FieldStorage() problem

Richard van de Stadt stadt at cs.utwente.nl
Tue Feb 6 04:51:53 EST 2001


Erno Kuusela wrote:
> 
> In article <3A7F20D9.4BE57828 at cs.utwente.nl>, Richard van de Stadt
> <stadt at cs.utwente.nl> writes:
> 
> | OSError: [Errno 24] Too many open files: '/var/tmp/@24739.61'
> 
> you probably just need to increase the resource limits for the account
> that your http daemon runs under. i don't know what kind of startup
> procedure you're using for the daemon so it's hard to say exactly how
> to fix it, but the /bin/sh command for manipulating resource limits is
> "ulimit" ("limit" with csh descendants).
> 
> if it still blows up after you've upped the limit, it might
> be a problem with the cgi module going haywire and opening
> new files boundlessly, but that seems pretty unlikely.

But still, it looks like that, although only 1 at the time.
The webform it gets to work with has 140 <input ...> lines,
while the number of temporary files that were created is 61.
The limit is probably set at 64, If you count the opening of
the script, and some modules, this makes sense.

It seems like each <input ...> line causes one temporary file to be
opened, although only 1 exists at the same time. Does cgi.FieldStorage()
work like that???

calling ulimit from within the script, which should, I think, do what you
suggest:

ulimitCommand = "/usr/bin/ulimit -n 512"
os.system (ulimitCommand)

doesn't help.

Richard.



More information about the Python-list mailing list