This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients martin.panter, nadeem.vawda, vstinner
Date 2015-09-21.05:48:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442814518.45.0.650566329915.issue25138@psf.upfronthosting.co.za>
In-reply-to
Content
Looking at this more closely, the check seems to be there just to check if basic DNS lookups are working. It was added for Issue 12804. One option might be to replace it with a support.transient_internet() handler:

# Check for internet access before running test (issue #12804).
with support.transient_internet('python.org'):
    socket.gethostbyname('python.org')
# these should all be successful
...

According to the socket module source code, gethostbyname() calls the OS-level getaddrinfo() rather gethostbyname(), hence the “gaierror” handling. The error codes that get raised seem to be a platform-dependent mess, but transient_internet() looks like it catches EAI_NONAME, _FAIL, _NODATA and WSANO_DATA (among others). EAI_NODATA seems to have been removed from RFC 3493 and current Posix, but was apparently originally meant to be for looking up records that did exist but (say) did not have any IP v4 addresses.
History
Date User Action Args
2015-09-21 05:48:38martin.pantersetrecipients: + martin.panter, vstinner, nadeem.vawda
2015-09-21 05:48:38martin.pantersetmessageid: <1442814518.45.0.650566329915.issue25138@psf.upfronthosting.co.za>
2015-09-21 05:48:38martin.panterlinkissue25138 messages
2015-09-21 05:48:37martin.pantercreate