newbie needs help building Python 2.5 for Fedora Core 6

2007-02-24 Thread 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')

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: newbie needs help building Python 2.5 for Fedora Core 6

2007-02-24 Thread Tony Nelson
In article [EMAIL PROTECTED],
 bobmon [EMAIL PROTECTED] wrote:

 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 
on FC6 w/ Python 2.5 (retyped, tho):

 import socket
 socket.gethostname()
'localhost.localdomain'
 socket.gethostbyname(_)
'127.0.0.1'


TonyN.:'[EMAIL PROTECTED]
  '  http://www.georgeanelson.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: newbie needs help building Python 2.5 for Fedora Core 6

2007-02-24 Thread bobmon
WOW.  I'm gobsmacked...

On Feb 24, 6:13 pm, Tony Nelson
[EMAIL PROTECTED] wrote:

 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.1localhostlocalhost.localdomainfoobar
and I get this result for my machine (foobar.foodomain.com):

 import socket
 socket.gethostname()
'foobar.foodomain.com'
 socket.gethostbyname(_)
Traceback (most recent call last):
  File stdin, line 1, in module
socket.gaierror: (-2, 'Name or service not known')


 socket.gethostbyname('localhost')
'127.0.0.1'
 socket.gethostbyname('localhost.localdomain')
'127.0.0.1'


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

 import socket
 socket.gethostname()
'foobar.foodomain.net'
 socket.gethostbyname(_)
'127.0.0.1'



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.

-- 
http://mail.python.org/mailman/listinfo/python-list