newbie needs help building Python 2.5 for Fedora Core 6

B

bobmon

Hello, and please be gentle...

I'm trying to build Python 2.5 on my Fedora Core 6 installation. I
think I've resolved most of my problems, but "make test" reports an
error for test_socket.py, shown below.

I suppose my FC6 installation is missing something, but I have no idea
what. Any ideas, directions, pointers would be most appreciated.



======================================================================
ERROR: testSockName (__main__.GeneralModuleTests)

----------------------------------------------------------------------
Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 456, in testSockName
my_ip_addr = socket.gethostbyname(socket.gethostname())
gaierror: (-2, 'Name or service not known')


----------------------------------------------------------------------
Ran 66 tests in 35.478s

FAILED (errors=1)
Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 962, in <module>
test_main()
File "./Lib/test/test_socket.py", line 958, in test_main
test_support.run_unittest(*tests)
File "/home/Installer/Python/Python-2.5/Lib/test/test_support.py",
line 441, in run_uni
ttest
run_suite(suite, testclass)
File "/home/Installer/Python/Python-2.5/Lib/test/test_support.py",
line 426, in run_sui
te
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 456, in testSockName
my_ip_addr = socket.gethostbyname(socket.gethostname())
gaierror: (-2, 'Name or service not known')
 
T

Tony Nelson

"bobmon said:
Hello, and please be gentle...

I'm trying to build Python 2.5 on my Fedora Core 6 installation. I
think I've resolved most of my problems, but "make test" reports an
error for test_socket.py, shown below.

I suppose my FC6 installation is missing something, but I have no idea
what. Any ideas, directions, pointers would be most appreciated.



======================================================================
ERROR: testSockName (__main__.GeneralModuleTests)

----------------------------------------------------------------------
Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 456, in testSockName
my_ip_addr = socket.gethostbyname(socket.gethostname())
gaierror: (-2, 'Name or service not known')


----------------------------------------------------------------------
Ran 66 tests in 35.478s

FAILED (errors=1)
Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 962, in <module>
test_main()
File "./Lib/test/test_socket.py", line 958, in test_main
test_support.run_unittest(*tests)
File "/home/Installer/Python/Python-2.5/Lib/test/test_support.py",
line 441, in run_uni
ttest
run_suite(suite, testclass)
File "/home/Installer/Python/Python-2.5/Lib/test/test_support.py",
line 426, in run_sui
te
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "./Lib/test/test_socket.py", line 456, in testSockName
my_ip_addr = socket.gethostbyname(socket.gethostname())
gaierror: (-2, 'Name or service not known')

OK, so this fails:

my_ip_addr = socket.gethostbyname(socket.gethostname())

Try it from the python command line. This is what happens when I try it
________________________________________________________________________
TonyN.:' *firstname*nlsnews@georgea*lastname*.com
' <http://www.georgeanelson.com/>
 
B

bobmon

WOW. I'm gobsmacked...

Try it from the python command line. This is what happens when I try it


Okay, that was interesting...

Apparently there's a subtlety of /etc/hosts that affects this!
Originally it had this line:
127.0.0.1 localhost localhost.localdomain foobar
and I get this result for my machine ("foobar.foodomain.com"): Traceback (most recent call last):

Whe I change /etc/hosts to this:
127.0.0.1 foobar foobar.foodomain.net
localhost.localdomain localhost
Python is happy and I get;

So, problem "fixed" although I have no real understanding of what was
wrong or what's right now.
Only that "gethostbyname()" seems to be really sensitive to the format
of the /etc/hosts file.

Thank you, Tony Nelson.
-Bob Montante, -bob,mon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top