[python] IOError (111, 'Connection refused') pri urllib.urlretrieve

.: smilelover :. smilelover na centrum.cz
Čtvrtek Únor 23 22:04:19 CET 2006


Zdravim,
mam Python CGI skript, ktery za pomoci funkce urllib.urlretrieve stahne  
stranku. Konkretne ten kousek vypada takto:

self.tmpString =  
urllib.urlopen("http://dictionary.cambridge.org/results.asp?searchword=%s"  
% urllib.quote(query)).read()

Kdyz pouztim skript u sebe na localhostu, jede OK, ale kdyz ho nahraju na  
server (konkretne na SourceForge.net, ale stalo se mi to i jinde), dostanu  
IOError.
SSHcknul jsem se tam a zkusil to, vypada to takhle:

Python 2.3.3 (#1, May  7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> print  
>>> urllib.urlopen("http://dictionary.cambridge.org/results.asp?searchword=evolution").read()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
     return opener.open(url)
   File "/usr/lib/python2.3/urllib.py", line 181, in open
     return getattr(self, name)(url)
   File "/usr/lib/python2.3/urllib.py", line 297, in open_http
     h.endheaders()
   File "/usr/lib/python2.3/httplib.py", line 712, in endheaders
     self._send_output()
   File "/usr/lib/python2.3/httplib.py", line 597, in _send_output
     self.send(msg)
   File "/usr/lib/python2.3/httplib.py", line 564, in send
     self.connect()
   File "/usr/lib/python2.3/httplib.py", line 548, in connect
     raise socket.error, msg
IOError: [Errno socket error] (111, 'Connection refused')

Musi to ten server nejak povolit nebo tak?
Dik

Dan



Další informace o konferenci Python