[Zope] (10065, 'No route to host')-problem with urllib:

Elena Schulz elena.schulz@gmx.net
Fri, 19 Oct 2001 18:31:50 +0200


Dear list,

inside of a python-script I use a function with urllib.urlopen(url) that =
I call from a dos-box outside of zope with "J:\Zope\ZopeSite\bin\python =
somescript.py" (on a windowsmachine: win98, zope 2.4.0, python 2.1, =
zope-install-folder=3D"J:\Zope\ZopeSite\"). The execution of the =
following function gets an error that I cannot solve:


# helper function to read the URL data
def readURL(url):
        """Returns the file found in the URL
        """
        f =3D urllib.urlopen(url)
        data =3D f.read()
        f.close()
        return data

where url=3D"http://pc-a:8080/0_folderfile_listing" =
("0_folderfile_listing" is a dtml-Methode in the root of Zope 2.4.0.)

I am logged in as annonymus but changed the security sothat annonymus =
can do everything under zope. In iexplorer v4.0 I reach =
http://pc-a:8080/0_folderfile_listing" without a problem and =
authentifying. But executing the "J:\Zope\ZopeSite\bin\python =
somescript.py" I get the following errorcode from python:

>>> Retrieving remote files from 'http://pc-a:8080'...
Listing remote directory 'http://pc-a:8080/'...
>>> Unhandled exception while debugging...
Traceback (most recent call last):
  File "j:\zope\ZopeSite\bin\lib\urllib.py", line 71, in urlopen
    return _urlopener.open(url)
  File "j:\zope\ZopeSite\bin\lib\urllib.py", line 176, in open
    return getattr(self, name)(url)
  File "j:\zope\ZopeSite\bin\lib\urllib.py", line 283, in open_http
    h.putrequest('GET', selector)
  File "j:\zope\ZopeSite\bin\lib\httplib.py", line 432, in putrequest
    self.send(str)
  File "j:\zope\ZopeSite\bin\lib\httplib.py", line 374, in send
    self.connect()
  File "j:\zope\ZopeSite\bin\lib\httplib.py", line 358, in connect
    self.sock.connect((self.host, self.port))
  File "<string>", line 1, in connect
IOError: [Errno socket error] (10065, 'No route to host')

Does anybody has a hint what to do? Many thanks for your replies ...

Elena