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

Expose current parse location to XMLParser #40813

Closed
davecole mannequin opened this issue Aug 24, 2004 · 5 comments
Closed

Expose current parse location to XMLParser #40813

davecole mannequin opened this issue Aug 24, 2004 · 5 comments

Comments

@davecole
Copy link
Mannequin

davecole mannequin commented Aug 24, 2004

BPO 1014930
Files
  • pyexpat.diff: Adds current parse location to expat XMLParser
  • pyexpat-v2.diff: Updated patch including reviewer suggestions
  • 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 = None
    closed_at = <Date 2004-08-26.00:41:35.000>
    created_at = <Date 2004-08-24.02:44:34.000>
    labels = ['expert-XML']
    title = 'Expose current parse location to XMLParser'
    updated_at = <Date 2004-08-26.00:41:35.000>
    user = 'https://bugs.python.org/davecole'

    bugs.python.org fields:

    activity = <Date 2004-08-26.00:41:35.000>
    actor = 'davecole'
    assignee = 'davecole'
    closed = True
    closed_date = None
    closer = None
    components = ['XML']
    creation = <Date 2004-08-24.02:44:34.000>
    creator = 'davecole'
    dependencies = []
    files = ['6211', '6212']
    hgrepos = []
    issue_num = 1014930
    keywords = ['patch']
    message_count = 5.0
    messages = ['46772', '46773', '46774', '46775', '46776']
    nosy_count = 2.0
    nosy_names = ['davecole', 'ddorfman']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1014930'
    versions = ['Python 2.4']

    @davecole
    Copy link
    Mannequin Author

    davecole mannequin commented Aug 24, 2004

    This patch adds CurrentByteIndex, CurrentColumnNumber,
    CurrentLineNumber members to the
    xml.parsers.expat.XMLParser object which respectively
    wrap the XML_GetCurrentByteIndex,
    XML_GetCurrentLineNumber, and
    XML_GetCurrentColumnNumber expat functions.

    @davecole davecole mannequin closed this as completed Aug 24, 2004
    @davecole davecole mannequin self-assigned this Aug 24, 2004
    @davecole davecole mannequin added the topic-XML label Aug 24, 2004
    @davecole davecole mannequin closed this as completed Aug 24, 2004
    @davecole davecole mannequin self-assigned this Aug 24, 2004
    @davecole davecole mannequin added the topic-XML label Aug 24, 2004
    @davecole
    Copy link
    Mannequin Author

    davecole mannequin commented Aug 24, 2004

    Logged In: YES
    user_id=28658

    Oops - obviously CurrentColumnNumber wraps
    XML_GetCurrentColumnNumber, and CurrentLineNumber wraps
    XML_GetCurrentLineNumber.

    @ddorfman
    Copy link
    Mannequin

    ddorfman mannequin commented Aug 24, 2004

    Logged In: YES
    user_id=908995

    The patch looks good to me after a quick glance and test
    run. Maybe add something to the test suite to exercise these
    attributes? It should be as easy as adding print statements
    to a handler or two (the test relies heavily on comparing
    the output to a known one). Most of the other attributes
    aren't tested-for by the test suite, though. \versionadded
    in the docs might be nice, too--just once, after the
    paragraph introducing them.

    @davecole
    Copy link
    Mannequin Author

    davecole mannequin commented Aug 26, 2004

    Logged In: YES
    user_id=28658

    Have added a unit test to check that the Current* members do
    return something useful for parser events. Decided against
    testing character data events as there can be more than one
    per section of character data - this might be fragile in the
    face of newer expat versions.

    Oh, also added a \versionadded. Will apply this patch.

    @davecole
    Copy link
    Mannequin Author

    davecole mannequin commented Aug 26, 2004

    Logged In: YES
    user_id=28658

    Patch applied:
    Doc/lib/libpyexpat.tex; new revision: 1.24
    Lib/test/test_pyexpat.py; new revision: 1.16
    Misc/NEWS; new revision: 1.1114
    Modules/pyexpat.c; new revision: 2.88

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants