[Python-bugs-list] [ python-Bugs-755080 ] AssertionError from urllib.retrieve / httplib

SourceForge.net noreply@sourceforge.net
Mon, 16 Jun 2003 12:40:03 -0700


Bugs item #755080, was opened at 2003-06-16 00:37
Message generated for change (Comment added) made by jhylton
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=755080&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stuart Bishop (zenzen)
Assigned to: Nobody/Anonymous (nobody)
Summary: AssertionError from urllib.retrieve / httplib

Initial Comment:

The following statement is occasionally generating
AssertionErrors:
    current_page = urllib.urlopen(action,data).read()

Traceback (most recent call last):
  File "/Users/zen/bin/autospamrep.py", line 161, in ?
    current_page = handle_spamcop_page(current_page)
  File "/Users/zen/bin/autospamrep.py", line 137, in 
handle_spamcop_page
    current_page = urllib.urlopen(action,data).read()
  File "/sw/lib/python2.3/httplib.py", line 1150, in read
    assert not self._line_consumed and self._line_left


Fix may be to do the following in 
LineAndFileWrapper.__init__ (last two lines are new):

def __init__(self, line, file):
        self._line = line
        self._file = file
        self._line_consumed = 0
        self._line_offset = 0
        self._line_left = len(line)
        if not self._line_left:
            self._done()


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

>Comment By: Jeremy Hylton (jhylton)
Date: 2003-06-16 19:40

Message:
Logged In: YES 
user_id=31392

Can you reproduce this problem easily?  We've seen something
like it before, but have had trouble figuring out what goes
wrong.


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

Comment By: Stuart Bishop (zenzen)
Date: 2003-06-16 00:55

Message:
Logged In: YES 
user_id=46639

My suggested fix is wrong.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=755080&group_id=5470