infinite loop with httplib?

Discussion in 'Python' started by Karl Witmann, Jul 9, 2004.

  1. Karl Witmann

    Karl Witmann Guest

    Anyone have experience with httplib getting stuck reading the first line
    of a file?

    Most urls work fine (of course), but I tried the following:
    http://216.117.129.109/robots.txt

    Both Firefox and IE return:
    fopen: No such file or directory
    httpd: could not open document config file /etc/httpd/conf/httpd.conf
    A misconfigured server...

    But for my test script:
    >>> import urllib2
    >>> f = urllib2.urlopen('http://216.117.129.109')


    >>> print f.readline()

    fopen: No such file or directory
    >>> print f.readline()

    fopen: No such file or directory
    >>> print f.readline()

    fopen: No such file or directory

    >>> print f.read()

    Traceback (most recent call last):
    File "<interactive input>", line 1, in ?
    File "C:\Python23\lib\httplib.py", line 1156, in read
    assert not self._line_consumed and self._line_left
    AssertionError

    Worse, the robotparser uses this code and thus ALL available memory:
    >>> import robotparser
    >>> rp = robotparser.RobotFileParser()
    >>> rp.set_url('http://216.117.129.109')
    >>> rp.read()

    a few minutes later, the kernel kills the process....

    Any ideas?

    I'd be fine if this returned an exception rather than a kernel panic.
    Karl Witmann, Jul 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vedran Vukotic

    infinite loop unexpectly dies

    Vedran Vukotic, Mar 2, 2006, in forum: Perl
    Replies:
    0
    Views:
    4,440
    Vedran Vukotic
    Mar 2, 2006
  2. Alexander Bosch

    Infinite loop when using Server.Transfer

    Alexander Bosch, Oct 28, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    854
    Steven Cheng[MSFT]
    Nov 10, 2004
  3. Alexander Bosch

    Infinite loop when using Server.Transfer

    Alexander Bosch, Oct 31, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    537
    Steven Cheng[MSFT]
    Nov 1, 2004
  4. Replies:
    5
    Views:
    579
    benben
    Jan 31, 2006
  5. Isaac Won
    Replies:
    9
    Views:
    341
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page