Good point, you are right. Thanks :) I can still commit a patch: really there just need a finally clause at the end of maybeParseConfig to close the file AFAI
Best, Nicolas On Mon, Mar 2, 2009 at 11:06 PM, Jean-Paul Calderone <[email protected]>wrote: > On Mon, 2 Mar 2009 22:55:26 +0100, Nicolas Toper <[email protected]> wrote: > >> Hi, >> >> It seems the resolv file in twisted.names.client#maybeParseConfig is >> never >> closed. This creates a exceptions.IOError: [Errno 24] Too many open >> files: '/etc/resolv.conf >> >> (FYI I am resolving a domain very often in my script). >> >> Am I correct? Would you like me to submit a patch to correct this? >> > > It's true that it isn't explicitly closed and fixing this would be nice. > However, unless you're using Jython or PyPy I don't think this is the > cause of your IOError. As soon as maybeParseConfig returns, CPython will > close the file, so it's not really a resource leak. > > Jean-Paul > > _______________________________________________ > Twisted-Python mailing list > [email protected] > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python >
_______________________________________________ Twisted-Python mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
