New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket module in 2.7.4 raises error instead of gaierror in 2.7.3 #61779
Comments
forwarded from https://launchpad.net/bugs/+bug/1154599 this seems to be changed behavior in 2.7.4. is it intended? $ cat lookup.py
#!/usr/bin/python
import sys, socket
names = ["slashdot.org", "foooooooooowhizzzzzzzz.com"]
if len(sys.argv) > 1:
names = sys.argv[1:]
for iname in names:
try:
result = socket.getaddrinfo(iname, None, 0, 0, socket.SOCK_STREAM,
socket.AI_CANONNAME)
for (fam, stype, proto, cname, sockaddr) in result:
sys.stdout.write("cname=%s, sockaddr=%s\n" % (cname, sockaddr))
except socket.gaierror as error:
sys.stderr.write("%s failed lookup" % iname)
$ python lookup.py # 2.7.3
cname=slashdot.org, sockaddr=('216.34.181.45', 0)
foooooooooowhizzzzzzzz.com failed lookup $ python lookup.py # 2.7.4
cname=slashdot.org, sockaddr=('216.34.181.45', 0)
Traceback (most recent call last):
File "lookup.py", line 9, in <module>
socket.AI_CANONNAME)
socket.error: [Errno 2] No such file or directory |
Not really intended I think. Can you try to bisect to find out the responsible changeset? |
(by the way, I can't reproduce here) |
I can't reproduce it. $ ./python lookup.py
slashdot.org failed lookup
foooooooooowhizzzzzzzz.com failed lookup Are you sure it's not some Ubuntu/Debian patch? |
Okay, so this is not a Python problem, but an Ubuntu problem. It's also not a problem with Ubuntu's version of Python. I can reproduce it on Ubuntu 13.04 with hg trunk, but not Debian Wheezy with hg trunk. Closing as invalid and will investigate further in Ubuntu. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: