a bug in urllib?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Haim Ashkenazi

    a bug in urllib?

    Hi

    I'm writing a script that uses urllib on win98. until now I used python
    2.3.x (x < 4) and it worked ok. I re-installed windows and installed
    python 2.3.4 and now I get an error when trying to open a url "no host
    given":

    Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32

    Type "copyright" , "credits" or "license()" for more information.



    *************** *************** *************** *************** ****

    Personal firewall software may warn about the connection IDLE

    makes to its subprocess using this computer's internal loopback

    interface. This connection is not visible on any external

    interface and no data is sent to or received from the Internet.

    *************** *************** *************** *************** ****



    IDLE 1.0.3
    [color=blue][color=green][color=darkred]
    >>> import urllib[/color][/color][/color]
    [color=blue][color=green][color=darkred]
    >>> f = urllib.URLopene r()[/color][/color][/color]
    [color=blue][color=green][color=darkred]
    >>> x = f.open('http://www.python.org' )[/color][/color][/color]



    Traceback (most recent call last):

    File "<pyshell#2 >", line 1, in -toplevel-

    x = f.open('http://www.python.org' )

    File "C:\PYTHON23\Li b\urllib.py", line 181, in open

    return getattr(self, name)(url)

    File "C:\PYTHON23\Li b\urllib.py", line 281, in open_http

    if not host: raise IOError, ('http error', 'no host given')

    IOError: [Errno http error] no host given
    [color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]

    --------------------------------------------

    I don't think it's a network error because I can browse to this site
    without a problem. does anyone have any idea? is it a bug? can anyone tell
    me where I can download an earlier version (not activestate, it's not
    running well on my win98)?

    Bye
    --
    Haim



  • GMTaglia

    #2
    Re: a bug in urllib?

    Haim Ashkenazi <haim@babysnake s.org> wrote in message news:<mailman.3 87.1088880858.2 7577.python-list@python.org >...[color=blue]
    > Hi
    >
    > I'm writing a script that uses urllib on win98. until now I used python
    > 2.3.x (x < 4) and it worked ok. I re-installed windows and installed
    > python 2.3.4 and now I get an error when trying to open a url "no host
    > given":
    >
    > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
    >
    > Type "copyright" , "credits" or "license()" for more information.
    >
    >
    >
    > *************** *************** *************** *************** ****
    >
    > Personal firewall software may warn about the connection IDLE
    >
    > makes to its subprocess using this computer's internal loopback
    >
    > interface. This connection is not visible on any external
    >
    > interface and no data is sent to or received from the Internet.
    >
    > *************** *************** *************** *************** ****
    >
    >
    >
    > IDLE 1.0.3
    >[color=green][color=darkred]
    > >>> import urllib[/color][/color]
    >[color=green][color=darkred]
    > >>> f = urllib.URLopene r()[/color][/color]
    >[color=green][color=darkred]
    > >>> x = f.open('http://www.python.org' )[/color][/color]
    >
    >
    >
    > Traceback (most recent call last):
    >
    > File "<pyshell#2 >", line 1, in -toplevel-
    >
    > x = f.open('http://www.python.org' )
    >
    > File "C:\PYTHON23\Li b\urllib.py", line 181, in open
    >
    > return getattr(self, name)(url)
    >
    > File "C:\PYTHON23\Li b\urllib.py", line 281, in open_http
    >
    > if not host: raise IOError, ('http error', 'no host given')
    >
    > IOError: [Errno http error] no host given
    >[color=green][color=darkred]
    > >>>[/color][/color]
    >
    > --------------------------------------------
    >
    > I don't think it's a network error because I can browse to this site
    > without a problem. does anyone have any idea? is it a bug? can anyone tell
    > me where I can download an earlier version (not activestate, it's not
    > running well on my win98)?
    >
    > Bye[/color]

    I have python 2.3.5a, as you can see it works properly:

    liquid@debian:~ $ python
    Python 2.3.5a0 (#2, Jul 3 2004, 18:39:53)
    [GCC 3.3.4 (Debian 1:3.3.4-2)] on linux2
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> import urllib
    >>> f = urllib.URLopene r()
    >>> x = f.open('http://www.python.org' )
    >>>[/color][/color][/color]

    I will have a look on windows as well
    Mario

    Comment

    • GMTaglia

      #3
      Re: a bug in urllib?

      Haim Ashkenazi <haim@babysnake s.org> wrote in message news:<mailman.3 87.1088880858.2 7577.python-list@python.org >...[color=blue]
      > Hi
      >
      > I'm writing a script that uses urllib on win98. until now I used python
      > 2.3.x (x < 4) and it worked ok. I re-installed windows and installed
      > python 2.3.4 and now I get an error when trying to open a url "no host
      > given":
      >
      > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
      >
      > Type "copyright" , "credits" or "license()" for more information.
      >
      >
      >
      > *************** *************** *************** *************** ****
      >
      > Personal firewall software may warn about the connection IDLE
      >
      > makes to its subprocess using this computer's internal loopback
      >
      > interface. This connection is not visible on any external
      >
      > interface and no data is sent to or received from the Internet.
      >
      > *************** *************** *************** *************** ****
      >
      >
      >
      > IDLE 1.0.3
      >[color=green][color=darkred]
      > >>> import urllib[/color][/color]
      >[color=green][color=darkred]
      > >>> f = urllib.URLopene r()[/color][/color]
      >[color=green][color=darkred]
      > >>> x = f.open('http://www.python.org' )[/color][/color]
      >
      >
      >
      > Traceback (most recent call last):
      >
      > File "<pyshell#2 >", line 1, in -toplevel-
      >
      > x = f.open('http://www.python.org' )
      >
      > File "C:\PYTHON23\Li b\urllib.py", line 181, in open
      >
      > return getattr(self, name)(url)
      >
      > File "C:\PYTHON23\Li b\urllib.py", line 281, in open_http
      >
      > if not host: raise IOError, ('http error', 'no host given')
      >
      > IOError: [Errno http error] no host given
      >[color=green][color=darkred]
      > >>>[/color][/color]
      >
      > --------------------------------------------
      >
      > I don't think it's a network error because I can browse to this site
      > without a problem. does anyone have any idea? is it a bug? can anyone tell
      > me where I can download an earlier version (not activestate, it's not
      > running well on my win98)?
      >
      > Bye[/color]

      I've just tried also in windows but no errors, same version as you

      Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
      Type "copyright" , "credits" or "license()" for more information.

      [color=blue][color=green][color=darkred]
      >>> import urllib
      >>> f = urllib.URLopene r()
      >>> x = f.open('http://www.python.org' )
      >>>[/color][/color][/color]

      Maybe you can reconsider a network error?
      ciao
      Mario

      Comment

      • Haim Ashkenazi

        #4
        Re: a bug in urllib?

        On Sun, 04 Jul 2004 08:38:56 -0700, GMTaglia wrote:
        [color=blue]
        > Haim Ashkenazi <haim@babysnake s.org> wrote in message news:<mailman.3 87.1088880858.2 7577.python-list@python.org >...[color=green]
        >> Hi
        >>
        >> I'm writing a script that uses urllib on win98. until now I used python
        >> 2.3.x (x < 4) and it worked ok. I re-installed windows and installed
        >> python 2.3.4 and now I get an error when trying to open a url "no host
        >> given":
        >>
        >> Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
        >>
        >> Type "copyright" , "credits" or "license()" for more information.
        >>
        >>
        >>
        >> *************** *************** *************** *************** ****
        >>
        >> Personal firewall software may warn about the connection IDLE
        >>
        >> makes to its subprocess using this computer's internal loopback
        >>
        >> interface. This connection is not visible on any external
        >>
        >> interface and no data is sent to or received from the Internet.
        >>
        >> *************** *************** *************** *************** ****
        >>
        >>
        >>
        >> IDLE 1.0.3
        >>[color=darkred]
        >> >>> import urllib[/color]
        >>[color=darkred]
        >> >>> f = urllib.URLopene r()[/color]
        >>[color=darkred]
        >> >>> x = f.open('http://www.python.org' )[/color]
        >>
        >>
        >>
        >> Traceback (most recent call last):
        >>
        >> File "<pyshell#2 >", line 1, in -toplevel-
        >>
        >> x = f.open('http://www.python.org' )
        >>
        >> File "C:\PYTHON23\Li b\urllib.py", line 181, in open
        >>
        >> return getattr(self, name)(url)
        >>
        >> File "C:\PYTHON23\Li b\urllib.py", line 281, in open_http
        >>
        >> if not host: raise IOError, ('http error', 'no host given')
        >>
        >> IOError: [Errno http error] no host given
        >>[color=darkred]
        >> >>>[/color]
        >>
        >> --------------------------------------------
        >>
        >> I don't think it's a network error because I can browse to this site
        >> without a problem. does anyone have any idea? is it a bug? can anyone tell
        >> me where I can download an earlier version (not activestate, it's not
        >> running well on my win98)?
        >>
        >> Bye[/color]
        >
        > I've just tried also in windows but no errors, same version as you
        >
        > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
        > Type "copyright" , "credits" or "license()" for more information.
        >
        >[color=green][color=darkred]
        >>>> import urllib
        >>>> f = urllib.URLopene r()
        >>>> x = f.open('http://www.python.org' )
        >>>>[/color][/color]
        >
        > Maybe you can reconsider a network error?[/color]
        no, it's not a network error (unless it's one of those weird windows
        settings. my network works fine. it's some kind of regular expression
        problem. when it parses the url it leaves the 'host' variable empty for
        some reason. I tried several versions and it's the same. the thing is, it
        worked under the same version of windows under 'vmware'. I solved it by
        upgrading Internet Explorer. maybe some file was corrupted during the
        windows installation (I just thank god I don't have to actually work on
        windows...).

        thanx
        --
        Haim



        Comment

        Working...