Skip to content
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

Closed
doko42 opened this issue Mar 30, 2013 · 5 comments
Closed

socket module in 2.7.4 raises error instead of gaierror in 2.7.3 #61779

doko42 opened this issue Mar 30, 2013 · 5 comments
Labels
release-blocker stdlib Python modules in the Lib dir

Comments

@doko42
Copy link
Member

doko42 commented Mar 30, 2013

BPO 17579
Nosy @warsaw, @doko42, @pitrou, @benjaminp

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:

assignee = None
closed_at = <Date 2013-04-02.18:27:47.241>
created_at = <Date 2013-03-30.12:26:50.704>
labels = ['invalid', 'library', 'release-blocker']
title = 'socket module in 2.7.4 raises error instead of gaierror in 2.7.3'
updated_at = <Date 2013-04-02.18:27:47.240>
user = 'https://github.com/doko42'

bugs.python.org fields:

activity = <Date 2013-04-02.18:27:47.240>
actor = 'barry'
assignee = 'none'
closed = True
closed_date = <Date 2013-04-02.18:27:47.241>
closer = 'barry'
components = ['Library (Lib)']
creation = <Date 2013-03-30.12:26:50.704>
creator = 'doko'
dependencies = []
files = []
hgrepos = []
issue_num = 17579
keywords = []
message_count = 5.0
messages = ['185553', '185559', '185560', '185561', '185853']
nosy_count = 4.0
nosy_names = ['barry', 'doko', 'pitrou', 'benjamin.peterson']
pr_nums = []
priority = 'release blocker'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue17579'
versions = ['Python 2.7']

@doko42
Copy link
Member Author

doko42 commented Mar 30, 2013

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

@doko42 doko42 added release-blocker stdlib Python modules in the Lib dir labels Mar 30, 2013
@pitrou
Copy link
Member

pitrou commented Mar 30, 2013

Not really intended I think. Can you try to bisect to find out the responsible changeset?

@pitrou
Copy link
Member

pitrou commented Mar 30, 2013

(by the way, I can't reproduce here)

@benjaminp
Copy link
Contributor

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?

@warsaw
Copy link
Member

warsaw commented Apr 2, 2013

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.

@warsaw warsaw closed this as completed Apr 2, 2013
@warsaw warsaw added the invalid label Apr 2, 2013
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

4 participants