Bugs item #1603527, was opened at 2006-11-27 05:43 Message generated for change (Comment added) made by rjbsourceforge You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1603527&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Eric S. Raymond (esr) Assigned to: Nobody/Anonymous (nobody) Summary: Python socket library confused by IPV6 notation in /etc/host Initial Comment: Robert J.Berger <[EMAIL PROTECTED]> reported this on the gpsd-dev mailing list of the GPSD project. "Until I changed the line in /etc/hosts from: ::1 localhost.localdomain localhost to: 127.0.0.1 localhost.localdomain localhost the gps.py [library distributed by the GPSD project] would fail when trying to open the socket connection to gpsd: File "/usr/local/bin/spGps.py", line 198, in __init__ self.connect(host, port) File "/usr/local/bin/spGps.py", line 237, in connect raise socket.error, msg socket.error: (111, 'Connection refused') This is with Python 2.4.4 under Red Hat Linux, kernel version not reported. Robert believes, and I concur, that this is not a GPSD bug. Rather, something lower-level -- possibly the Python socket library, possibly some C library it uses -- is having indigestion on the IPV6 notation. ---------------------------------------------------------------------- Comment By: Robert J. Berger (rjbsourceforge) Date: 2006-12-03 20:15 Message: Logged In: YES user_id=29744 Originator: NO I will try to get a simple example that reproduces it. Unfortunately I don't have access to the system that was doing it today. I will try to get something in the bug report in the next day or so. But basically if /etc/hosts had localhost defined as ::1 the connect method failded, when I set localhost to 127.0.0.1 the connect worked. Other non-python (c++) processes were able to access the socket when localhost was set to ::1 This was on Fedora Core 6 with the latest patches at that time. ---------------------------------------------------------------------- Comment By: Eric S. Raymond (esr) Date: 2006-12-01 22:18 Message: Logged In: YES user_id=3060 Originator: YES >Are you sure this isn't a local misconfiguration? I'm not. I didn't see it happen. I suggest you email Mr. Berger and ask him. ---------------------------------------------------------------------- Comment By: Jp Calderone (kuran) Date: 2006-12-01 21:10 Message: Logged In: YES user_id=366566 Originator: NO This seems to work fine for me: >>> s = socket.socket(socket.AF_INET6) >>> s.bind(('ip6-localhost', 8091)) >>> s.getsockname() ('::1', 8091, 0, 0) >>> [EMAIL PROTECTED]:~$ grep ip6-localhost /etc/hosts ::1 ip6-localhost ip6-loopback [EMAIL PROTECTED]:~$ Are you sure this isn't a local misconfiguration? Perhaps gpsd isn't listening on ::1, only 127.1? ---------------------------------------------------------------------- Comment By: Eric S. Raymond (esr) Date: 2006-11-29 21:35 Message: Logged In: YES user_id=3060 Originator: YES host is 'localhost' port is 2947 What's going on here is that gps.py is a Python client module for a local daemon that monitors GPS devices on the host's serial and USB ports and presents output on port 2947. While it is possible to use gps.py to monitor a remote host, Berger wasn't doing that. The socket module threw an error while attempting to connect to localhost. ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2006-11-29 21:18 Message: Logged In: YES user_id=21627 Originator: NO Can you please report the values of "host" and "port" when that error is raised? ---------------------------------------------------------------------- Comment By: Eric S. Raymond (esr) Date: 2006-11-27 06:03 Message: Logged In: YES user_id=3060 Originator: YES Berger reports the kernel is 2.6.18. Fedora Core 6. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1603527&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com