[Twisted-Python] Can browse, but getPage() fails on localhost address

Steve Steiner (listsin) listsin at integrateddevcorp.com
Thu Oct 29 10:49:55 MDT 2009


I can browse to either URL in any browser, getPage() works fine on the  
external address, 404's on the localhost address.

Any insight greatly appreciated; this is about as simple a test case  
as there can be and I'm mystified as to why it's not working.  Of  
course, that probably means I'll feel like a complete moron when  
someone clops me on the head with the answer, but I can deal with  
that...

Thanks,

S

Just in case it gets mutilated by mail:

	http://pastebin.com/d2f80ce0a

from twisted.web import client

def showPage(pageData):
     print pageData
     reactor.stop()

def handleError(failure):
     print "Error:", failure.getErrorMessage()
     failure.printDetailedTraceback()
     reactor.stop()

if __name__ == "__main__":
     from twisted.internet import reactor
     # postRequest = client.getPage("http://localhost/w3c-validator/check 
")
     postRequest = client.getPage("http://validator.w3.org/check")
     postRequest.addCallback(showPage).addErrback(handleError)
     reactor.run()


-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20091029/a8a571ef/attachment.html>


More information about the Twisted-Python mailing list