open function fail after running a day

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


In article <1181226795.455934.177550 at n15g2000prd.googlegroups.com>,
 alexteo21 <alexteo21 at yahoo.com> 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 "./alexCopy.py", line 459, in processRequestModule
>     sanityTestSteps(reqId,model)
>   File "./alexCopy.py", 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

-- 
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more



More information about the Python-list mailing list