[Python-bugs-list] [ python-Bugs-711632 ] htmllib.HTMLParser.anchorlist problem

SourceForge.net noreply at sourceforge.net
Fri Sep 12 12:38:58 EDT 2003


Bugs item #711632, was opened at 2003-03-29 01:26
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=711632&group_id=5470

Category: Python Library
Group: Python 2.2.2
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Chris Gray (cpgray)
Assigned to: Nobody/Anonymous (nobody)
Summary: htmllib.HTMLParser.anchorlist problem

Initial Comment:
htmllib.HTMLParser.anchorlist is cleared when

__init__() is called but not when reset() is called. 

Processing more than one document with the same

instance accumulates anchors from all documents

processed in the list.



Arguably a feature not a bug, but it makes sense for

reset to clear whatever is initialized by __init__.



Here is an illustrative IDLE session:



Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit

(Intel)] on win32

Type "copyright", "credits" or "license" for more

information.

IDLE 0.8 -- press F1 for help

>>> import htmllib

>>> import formatter

>>> p = htmllib.HTMLParser(formatter.NullFormatter())

>>> p.feed('<a href="http://www.python.org">Python</a>')

>>> p.anchorlist

['http://www.python.org']

>>> p.reset()

>>> p.feed('<a

href="http://sourceforge.net/">Sourceforge</a>')

>>> p.anchorlist

['http://www.python.org', 'http://sourceforge.net/']

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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-09-12 18:38

Message:
Logged In: YES 
user_id=21627

Fixed with #793021.

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

Comment By: Andrew Gaul (gaul)
Date: 2003-08-22 10:44

Message:
Logged In: YES 
user_id=139865

See patch 793021 for a fix.

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

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



More information about the Python-bugs-list mailing list