This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: markupbase parse_declaration cannot recognize comments
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, jimjjewett
Priority: low Keywords:

Created on 2003-05-12 20:34 by jimjjewett, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (3)
msg15982 - (view) Author: Jim Jewett (jimjjewett) Date: 2003-05-12 20:34
In markupbase class parser method parse_declaration

It verfies that the first two characters are "<!"

Then it returns -1 if the next character is "-".

After that, it checks to see if the next two characters 
are "--", but if they were, it would already have returned.

Solution:  Check for comments before checking for a 
short buffer.

        if rawdata[j:j+1] == '--': #comment
            # Locate --.*-- as the body of the comment
            return self.parse_comment(i)
        if rawdata[j:j+1] in ("-", ""):
            # Start of comment followed by buffer 
            # boundary, or just a buffer boundary.
            return -1
msg15983 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-09-09 05:18
Logged In: YES 
user_id=3066

As noted in the related patch (#901369), this probably
shouldn't be considered a bug.  Keeping this open pending
outcome of email discussion with OP.
msg15984 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2005-08-23 04:09
Logged In: YES 
user_id=3066

Closed by docstring change in Lib/markupbase.py revisions
1.11, 1.10.4.1.
History
Date User Action Args
2022-04-10 16:08:43adminsetgithub: 38491
2003-05-12 20:34:28jimjjewettcreate