View previous topic :: View next topic |
Author |
Message |
frank1980 Tux's lil' helper
Joined: 19 Feb 2006 Posts: 103
|
Posted: Tue May 01, 2007 4:24 am Post subject: python problem: can't urlopen |
|
|
Yesterday, I found my python can't use urlopen function, not only module urllib,but also urllib2.
In console mode, try " file=urllib.urlopen('http://www.google.com'), it raises error like this:
Code: | Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib64/python2.4/urllib.py", line 82, in urlopen
return opener.open(url)
File "/usr/lib64/python2.4/urllib.py", line 190, in open
return getattr(self, name)(url)
File "/usr/lib64/python2.4/urllib.py", line 313, in open_http
h.endheaders()
File "/usr/lib64/python2.4/httplib.py", line 798, in endheaders
self._send_output()
File "/usr/lib64/python2.4/httplib.py", line 679, in _send_output
self.send(msg)
File "/usr/lib64/python2.4/httplib.py", line 646, in send
self.connect()
File "/usr/lib64/python2.4/httplib.py", line 614, in connect
socket.SOCK_STREAM):
IOError: [Errno socket error] (-2, 'Name or service not known') |
I try to boot with livecd 2006.1, it's OK, and the same version of python. Also I re-emerged python, but still failed. |
|
Back to top |
|
|
KRF Tux's lil' helper
Joined: 17 Jun 2006 Posts: 124 Location: Germany
|
Posted: Fri May 04, 2007 2:01 pm Post subject: |
|
|
Sounds like a dns problem, the python module cannot lookup google.com's ip address. _________________
Gentoo Linux, running kde-3.5
CPU: i686 Intel P4 2.80GHz | RAM: 2048MB DDR
Profile: gentoo-sources-2.6.23*, gcc-4.1*, portage-2.1.3* (2007.0)
Please add [SOLVED] to your message title if your problem is solved. |
|
Back to top |
|
|
frank1980 Tux's lil' helper
Joined: 19 Feb 2006 Posts: 103
|
Posted: Mon May 07, 2007 8:06 am Post subject: |
|
|
It's not only python's problem, but also perl\ruby, all the same.
I don't know how to deal with it, it's system's problem.
If I use IP directly, it's OK |
|
Back to top |
|
|
d_m Guru
Joined: 12 Jun 2003 Posts: 570 Location: Philadelphia, PA, USA
|
Posted: Mon May 07, 2007 3:44 pm Post subject: |
|
|
If you ping the hostname you are trying to connect to... what happens?
Does DNS work in firefox/etc.? _________________ The name that can be named is not the eternal name. |
|
Back to top |
|
|
frank1980 Tux's lil' helper
Joined: 19 Feb 2006 Posts: 103
|
Posted: Tue May 08, 2007 1:37 pm Post subject: |
|
|
d_m wrote: | If you ping the hostname you are trying to connect to... what happens?
Does DNS work in firefox/etc.? |
I ping www.google.com,sounds good
Code: | PING www-china.l.google.com (66.249.89.99) 56(84) bytes of data.
64 bytes from jp-in-f99.google.com (66.249.89.99): icmp_seq=1 ttl=244 time=195 ms
64 bytes from jp-in-f99.google.com (66.249.89.99): icmp_seq=2 ttl=243 time=194 ms
|
DNS workd fine in firefox, konq............
by the way, my computer behind double routers. |
|
Back to top |
|
|
frank1980 Tux's lil' helper
Joined: 19 Feb 2006 Posts: 103
|
Posted: Sat May 12, 2007 3:14 pm Post subject: |
|
|
One time I updated my system,sys-auth/nss-mdns blocking net-misc/mDNSResponder,I del ti, is that point? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|