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

Steve Steiner (listsin) listsin at integrateddevcorp.com
Thu Oct 29 13:36:26 EDT 2009

On Oct 29, 2009, at 1:10 PM, Maarten ter Huurne wrote:

> On Thursday 29 October 2009, Steve Steiner (listsin) wrote:
>> I can browse to either URL in any browser, getPage() works fine on  
>> the
>> external address, 404's on the localhost address.
> Does the same thing happen with "" instead of "localhost"  
> in the
> URL? I once encountered a nasty setup where a machine itself did not  
> have
> "localhost" in /etc/hosts and the DNS server returned the IP address  
> of
> another machine on the network...

Yes, unfortunately, same thing and the hosts file is also correct.

This is in OS X, and the valida†or URL I'm calling is being served by  
Apache 2.2, and is a ScriptAlias like so (in an includ of httpd.conf):

ScriptAlias      /w3c-validator/check   '/Applications/Validator- 

Thing that's got me baffled is that I can go to it just fine in a  
browser, I can `curl` it, but, now, after a little more digging, wget  
can't get it either!

curl  http://localhost/w3c-validator/check			   <-- returns HTML code
any browser to  http://localhost/w3c-validator/check  <-- returns HTML  
t.w.c.getPage("http://localhost/w3c-validator/check") <-- 404
wget  http://localhost/w3c-validator/check		   <-- 404

So what the heck is the difference in how these things resolve that  



More information about the Twisted-Python mailing list