How do I fix the error socket.gaierror: [Errno -2] Name or service not known on debian/testing?

As you can see here I am able to reproduce this bug on my debian/testing system: (Debian GNU/Linux wheezy/sid)

Do you have any suggestions for fixing this? My eglibc-source is up to date:

schemelab@li2-168:~/prg/zeek-autopost/python-rewards$ apt-cache show eglibc-source
Package: eglibc-source
Source: eglibc
Version: 2.13-33
Installed-Size: 20604
Maintainer: GNU Libc Maintainers <>
Architecture: all
Recommends: xz-utils
Description-en: Embedded GNU C Library: sources This package contains the sources and patches which are needed to build eglibc.

2 Answers

You've passed an extra unnecessary (and invalid) parameter to socket.getaddrinfo(). Try this instead:

socket.getaddrinfo("bitbucket.org", 80);

There is no real socket error here. If you look at your program, you are not providing the right arguments to the function. One function expects the host and the other expects the path. Neither expects a full url.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like