Comment #1 on issue 42 by zerbie: formfile not closing uploaded files
http://code.google.com/p/twill/issues/detail?id=42
(No comment was entered for this change.)
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #2 on issue 42 by the.good.doctor.is.in: formfile not closing
uploaded files
http://code.google.com/p/twill/issues/detail?id=42
See ClientForm.py, class FileControl.
Possible solutions: document the problem (which is indeed that the fp is
stored until
the file control is garbage collected) and leave it at that;
run 'gc.collect' after
every form submit; use some sort of post-submit callback to close the fp;
or read the
entire file into memory and use a cStringIO to store it, which will solve
the file
handle problem by ballooning memory.
I like #2 or #3 (gc or post-submit callback). Comments?
I vote for the post-submit callback. It seems cleanest, and does not
involve the
phrase "ballooning memory."