indeed, it is not being closed.  You can fix commands.py yourself (with
an fp.close()) or you can just run the garbage collector,

import gc
gc.collect()

I'll patch this next time I work on twill, thanks for finding it!

--titus

On Fri, Apr 04, 2008 at 03:21:11PM +0000, STM 16 wrote:
-> 
-> 
-> Subject: Is formfile closing uploaded file ?From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: Fri, 4 Apr 2008 08:19:52 -0700I'm sorry, for spam reasons, I've 
disabled posting from non-members.Please send your post directly to [EMAIL 
PROTECTED] and I will post it,OR just subscribe to the list and send your 
message directory. thanks, --titus 
-> --Forwarded Message Attachment--From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: 
Is formfile closing uploaded file ?Date: Fri, 4 Apr 2008 15:19:46 +0000 Hi ! I 
am using twill-0.9b1-py2.5. I am having problems to delete (unlink) a file 
after being uploaded using formfile until Py script is finished. Checking 
commands.py I found: "... browser.clicked(form, control) fp = open(filename, 
'rb') control.add_file(fp, content_type, filename)  print>>OUT, '\nAdded file 
"%s" to file upload field "%s"\n' % (filename,control.name,)..." I could not 
find something like fp.close() in commands.py neither in browser.py. Any 
suggest on how to be able to unlink a file after being uploaded. I am currently 
uploading log files and I am needing to exit python script (I would prefer to 
loop release space just from inside script) after sucessfully upload so that 
file is released. Kind Regards, 
SM//_________________________________________________________________Going 
green? See the top 12 foods to eat 
organic.http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A
-> _________________________________________________________________
-> More immediate than e-mail? Get instant access with Windows Live Messenger.
-> 
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008

_______________________________________________
twill mailing list
[email protected]
http://lists.idyll.org/listinfo/twill

Reply via email to