Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markupbase parse_declaration cannot recognize comments #38491

Closed
jimjjewett mannequin opened this issue May 12, 2003 · 3 comments
Closed

markupbase parse_declaration cannot recognize comments #38491

jimjjewett mannequin opened this issue May 12, 2003 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@jimjjewett
Copy link
Mannequin

jimjjewett mannequin commented May 12, 2003

BPO 736659
Nosy @freddrake

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/freddrake'
closed_at = <Date 2005-08-23.04:09:11.000>
created_at = <Date 2003-05-12.20:34:28.000>
labels = ['library']
title = 'markupbase parse_declaration cannot recognize comments'
updated_at = <Date 2005-08-23.04:09:11.000>
user = 'https://bugs.python.org/jimjjewett'

bugs.python.org fields:

activity = <Date 2005-08-23.04:09:11.000>
actor = 'fdrake'
assignee = 'fdrake'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2003-05-12.20:34:28.000>
creator = 'jimjjewett'
dependencies = []
files = []
hgrepos = []
issue_num = 736659
keywords = []
message_count = 3.0
messages = ['15982', '15983', '15984']
nosy_count = 2.0
nosy_names = ['fdrake', 'jimjjewett']
pr_nums = []
priority = 'low'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue736659'
versions = []

@jimjjewett
Copy link
Mannequin Author

jimjjewett mannequin commented May 12, 2003

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

@jimjjewett jimjjewett mannequin closed this as completed May 12, 2003
@jimjjewett jimjjewett mannequin assigned freddrake May 12, 2003
@jimjjewett jimjjewett mannequin added the stdlib Python modules in the Lib dir label May 12, 2003
@jimjjewett jimjjewett mannequin closed this as completed May 12, 2003
@jimjjewett jimjjewett mannequin assigned freddrake May 12, 2003
@jimjjewett jimjjewett mannequin added the stdlib Python modules in the Lib dir label May 12, 2003
@freddrake
Copy link
Member

Logged In: YES
user_id=3066

As noted in the related patch (bpo-901369), this probably
shouldn't be considered a bug. Keeping this open pending
outcome of email discussion with OP.

@freddrake
Copy link
Member

Logged In: YES
user_id=3066

Closed by docstring change in Lib/markupbase.py revisions
1.11, 1.10.4.1.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant