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.

classification
Title: test_socket fails when not connected
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, mbrierst
Priority: normal Keywords:

Created on 2003-03-19 19:12 by mbrierst, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (3)
msg15204 - (view) Author: Michael Stone (mbrierst) Date: 2003-03-19 19:12
Should test_socket require the network resource
be enabled?  It only works for me when I'm
connected (Running an old slackware linux).
This is true of both CVS and 2.2 python

When not connected testHostnameRes fails because
getfqdn() returns my hostname, 'zazz', but
gethostbyaddr(ip) returns the hostname 'localhost'.
When I am connected getfqdn() also returns
'localhost' so there's no problem.  It could be
fixed for me by either requiring the network
resource or changing line 234 of test_socket from:
all_host_names = [hname] + aliases
to:
all_host_names = [hname, hostname] + aliases

Or maybe my machine's setup is just messed
up in which case I trust you'll close the bug.
msg15205 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-08 22:38
Logged In: YES 
user_id=357491

The purpose of the network resource if for when you need to 
connect to the Internet, not to use sockets so the test is correct 
in that regard.
msg15206 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2005-03-11 00:27
Logged In: YES 
user_id=357491

This can either be considered invalid because of my previous comment 
explaining why the 'network' resource is not appropriate for test_socket, or 
it can be considered fix since I just coincidentally fixed test_socket in the 
exact same way Michael suggested.

Either way it is now closed.
History
Date User Action Args
2022-04-10 16:07:47adminsetgithub: 38183
2003-03-19 19:12:00mbrierstcreate