[Twisted-Python] Bug in twisted.names.client

Jean-Paul Calderone exarkun at divmod.com
Mon Mar 2 17:06:16 EST 2009

On Mon, 2 Mar 2009 22:55:26 +0100, Nicolas Toper <ntoper at gmail.com> wrote:
>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.


More information about the Twisted-Python mailing list