Good point, you are right. Thanks :)<br><br> I can still commit a patch: really there just need a finally clause at the end of maybeParseConfig to close the file AFAI<br><br>Best,<br>Nicolas<br><br><div class="gmail_quote">
On Mon, Mar 2, 2009 at 11:06 PM, Jean-Paul Calderone <span dir="ltr">&lt;<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Mon, 2 Mar 2009 22:55:26 +0100, Nicolas Toper &lt;<a href="mailto:ntoper@gmail.com" target="_blank">ntoper@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
It seems the resolv file in  twisted.names.client#maybeParseConfig is never<br>
closed. This creates a     exceptions.IOError: [Errno 24] Too many open<br>
files: &#39;/etc/resolv.conf<br>
<br>
(FYI  I am resolving a domain very often in my script).<br>
<br>
Am I correct? Would you like me to submit a patch to correct this?<br>
</blockquote>
<br></div>
It&#39;s true that it isn&#39;t explicitly closed and fixing this would be nice.<br>
However, unless you&#39;re using Jython or PyPy I don&#39;t think this is the<br>
cause of your IOError.  As soon as maybeParseConfig returns, CPython will<br>
close the file, so it&#39;s not really a resource leak.<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br>