Wow, I feel like an idiot now!&nbsp; I never thought to test that.&nbsp; Thank you so much!<br><br>Is there any reason DNS would work in a standalone python app and when I embed the library via the C API dns stops working?&nbsp; Is there a library I should import to fix that?<br>
<br>James<br><br><div class="gmail_quote">On Thu, Dec 4, 2008 at 10:43 AM, 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><div></div><div class="Wj3C7c">On Thu, 4 Dec 2008 10:28:46 -0500, James Joplin &lt;<a href="mailto:thejayjay@gmail.com" target="_blank">thejayjay@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;">
We have been using python embedded via the C API and have used Twisted for<br>
various things. &nbsp;We have come across some strange behavior and I cannot<br>
figure out what is going on.<br>
<br>
<br>
from twisted.internet import reactor<br>
from twisted.web.client import downloadPage<br>
<br>
...<br>
<br>
def fetchRepo():<br>
 &nbsp; &nbsp; &nbsp; global gameType, gameName, setupComplete, cp<br>
 &nbsp; &nbsp; &nbsp; if (setupComplete):<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url = urlbase + &quot;/&quot; + gameType + &quot;/&quot; + gameName +<br>
&quot;/repo.ini&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;url is : &quot; + url<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d = downloadPage(url, &quot;C:\\svntest\\gamerepo.ini&quot;)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.addCallback(downloadSuccess)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.addErrback(downloadFailure)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #cp.readfp(open(&quot;C:\\game-repo.ini&quot;))<br>
 &nbsp; &nbsp; &nbsp; else:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;urls not setup, throw errors etc.&quot;<br>
...<br>
<br>
This is an example of how we have been using downloadPage from<br>
twisted.web.client. &nbsp;I have no problems getting the example to work when I<br>
make a simple app or write the code into the intrepeter. &nbsp;But if I use it<br>
inside my app I get the user timeout below.<br>
<br>
Unhandled error in Deferred:<br>
Traceback (most recent call last):<br>
Failure: twisted.internet.error.TimeoutError: User timeout caused connection<br>
failure.<br>
<br>
<br>
Am I forgetting something trivial? &nbsp;The reactor is running as we use PB for<br>
database pooling. &nbsp;Can I not call downloadPage after a reactor is setup and<br>
connected?<br>
</blockquote>
<br></div></div>
Calling downloadPage after reactor.run is fine. &nbsp;I&#39;d take a look at DNS and<br>
firewall settings for problems there.<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>