Python 2.0.1 bug?
Gordon McMillan
gmcm at hypernet.com
Fri Jul 20 17:23:54 EDT 2001
[posted and mailed]
TheDustbustr) wrote:
[snip]
> HOST = '' # empty string meaning localhost
It means INADDR_ANY (it's visible from outside, unlike localhost).
[snip]
> while 1:
> conn, addr = s.accept()
> print 'Connected by', addr
> data = conn.recv(1024)
> print data
> conn.send(data) # reference point 1
> conn.close()
[snip]
> When you run this program then point your webbrowser to localhost:8080,
> you SHOULD see your GET / HTTP/1.1 request echoed to the screen (the
> "webpage"), as well as echoed to the console. Well, under Python 1.5.2
> running under Linux, it does. Running 2.0.1 under Windows 95, it
> doesn't, *nothing* is printed to the webbrowser.
Try it with the same browser. The problem may be
that on Windows 95, your browser is doing HTTP/1.1 but
on Linux it's doing HTTP/1.0. Socket handling is different
between the two.
Or it could be that your Windows browser is waiting to see a proper
HTTP response, but your Linux browser is being "forgiving".
Browsers are notoriously difficult beasts, so I would definitely
look there first.
- Gordon
More information about the Python-list
mailing list