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

SourceForge.net noreply@sourceforge.net
Sun, 15 Jun 2003 17:37:03 -0700


Bugs item #755080, was opened at 2003-06-16 10:37
Message generated for change (Tracker Item Submitted) made by Item Submitter
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()


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

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