Message6323
When trying to connect via httplib, like this
conn = httplib.HTTPConnection('localhost', 8080)
...
conn.request("GET", "/index.html", body, headers)
when there is nothing running on localhost:8080, a rather confusing error message is printed:
"Only AF_INET sockets are currently supported on jython"
With the provided patch, the error message reads
"socket.error: (10061, 'Connection refused')"
which is what I would expect in this case.
IMHO when (whoever) decided to not support IPv6 he/she just overlooked this particular piece of code in httplib.py. As long as IPv6 is not supported, httplib should not use
socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM)
(or socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM) which is the same)
but instead should use
socket.getaddrinfo(self.host, self.port, socket.AF_INET, socket.SOCK_STREAM)
This is related to Issue 1210. |
|
Date |
User |
Action |
Args |
2011-01-14 08:22:40 | basti1302 | set | recipients:
+ basti1302 |
2011-01-14 08:22:40 | basti1302 | set | messageid: <1294993360.01.0.56041773786.issue1697@psf.upfronthosting.co.za> |
2011-01-14 08:22:39 | basti1302 | link | issue1697 messages |
2011-01-14 08:22:39 | basti1302 | create | |
|