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

Nicolas Toper ntoper at gmail.com
Mon Mar 2 17:33:57 EST 2009


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 <exarkun at divmod.com>wrote:

> On Mon, 2 Mar 2009 22:55:26 +0100, Nicolas Toper <ntoper at gmail.com> 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
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090302/e8bb5353/attachment.htm 


More information about the Twisted-Python mailing list