Wow, I feel like an idiot now! I never thought to test that. 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? 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"><<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>></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 <<a href="mailto:thejayjay@gmail.com" target="_blank">thejayjay@gmail.com</a>> 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. 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>
global gameType, gameName, setupComplete, cp<br>
if (setupComplete):<br>
url = urlbase + "/" + gameType + "/" + gameName +<br>
"/repo.ini"<br>
print "url is : " + url<br>
d = downloadPage(url, "C:\\svntest\\gamerepo.ini")<br>
d.addCallback(downloadSuccess)<br>
d.addErrback(downloadFailure)<br>
#cp.readfp(open("C:\\game-repo.ini"))<br>
else:<br>
print "urls not setup, throw errors etc."<br>
...<br>
<br>
This is an example of how we have been using downloadPage from<br>
twisted.web.client. I have no problems getting the example to work when I<br>
make a simple app or write the code into the intrepeter. 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? The reactor is running as we use PB for<br>
database pooling. 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. I'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>