"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: > >>I've spent about a day investigating our "too many open files" error. I >>found the following: >> >> 1. Windows XP allows a Python 2.5 script to open 509 concurrent >> files. > > And do you actually need so many open files simultaneously? > Try to close them explicitely when you finish working on them - do not > rely on GC for closing files. This has *always* been the recomended > practice (except maybe, inside a short script that finishes quickly). > On Python 2.5 you can use the new `with` statement. > > > -- > Gabriel Genellina > Softlab SRL
After a quick scan of this thread, I didn't see the actual source for your call to the file's close(). Is it perhaps "file.close" and not "file.close()"? Forgotten parentheses won't give an error and won't close the file. >>> f=file('blah.txt','wt') >>> f <open file 'blah.txt', mode 'wt' at 0x00ECB9F8> >>> f.close <built-in method close of file object at 0x00ECB9F8> >>> f <open file 'blah.txt', mode 'wt' at 0x00ECB9F8> >>> f.close() >>> f <closed file 'blah.txt', mode 'wt' at 0x00ECB9F8> >>> -Mark Tolonen -- http://mail.python.org/mailman/listinfo/python-list