We have been using python embedded via the C API and have used Twisted for various things. We have come across some strange behavior and I cannot 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 + "/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 twisted.web.client. I have no problems getting the example to work when I make a simple app or write the code into the intrepeter. But if I use it 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 failure.<br><br><br>Am I forgetting something trivial? The reactor is running as we use PB for database pooling. Can I not call downloadPage after a reactor is setup and connected?<br>
<br>James<br><br>