open function fail after running a day

Nikita the Spider NikitaTheSpider at
Thu Jun 7 17:02:53 CEST 2007

In article <1181226795.455934.177550 at>,
 alexteo21 <alexteo21 at> wrote:

> The script is working fine on the day of execution.
> It is able to process the data files very hour.  However, the
> processing fail one day later i.e. the date increment by 1.
> Traceback (most recent call last):
>   File "./", line 459, in processRequestModule
>     sanityTestSteps(reqId,model)
>   File "./", line 699, in sanityTestSteps
>     t = open(filename, 'rb')
> IOError: [Errno 24] Too many open files:
> I have explicitly closed the file.  Is there something else I need to
> do?

Sounds like the .close() isn't getting executed as you think. Try using 
the logging module to log a line immediately before each open and close 
so that you can ensure you're really closing all the files. 
Alternatively, some other bit of code my be the guilty party. A utility 
like fstat can show you who has files open.

Good luck

Whole-site HTML validation, link checking and more

More information about the Python-list mailing list