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

patch for etree cdata and attr quoting #42871

Closed
chrism mannequin opened this issue Feb 4, 2006 · 6 comments
Closed

patch for etree cdata and attr quoting #42871

chrism mannequin opened this issue Feb 4, 2006 · 6 comments

Comments

@chrism
Copy link
Mannequin

chrism mannequin commented Feb 4, 2006

BPO 1424171
Nosy @birkenfeld
Files
  • betterescape.patch
  • 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 2006-02-08.17:00:56.000>
    created_at = <Date 2006-02-04.18:23:43.000>
    labels = ['expert-XML']
    title = 'patch for etree cdata and attr quoting'
    updated_at = <Date 2006-02-08.17:00:56.000>
    user = 'https://bugs.python.org/chrism'

    bugs.python.org fields:

    activity = <Date 2006-02-08.17:00:56.000>
    actor = 'chrism'
    assignee = 'effbot'
    closed = True
    closed_date = None
    closer = None
    components = ['XML']
    creation = <Date 2006-02-04.18:23:43.000>
    creator = 'chrism'
    dependencies = []
    files = ['1890']
    hgrepos = []
    issue_num = 1424171
    keywords = []
    message_count = 6.0
    messages = ['27438', '27439', '27440', '27441', '27442', '27443']
    nosy_count = 3.0
    nosy_names = ['effbot', 'georg.brandl', 'chrism']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1424171'
    versions = ['Python 2.5']

    @chrism
    Copy link
    Mannequin Author

    chrism mannequin commented Feb 4, 2006

    Attached is a patch for ElementTree (based on a checkout from the SVN
    trunk's xmlcore.etree) that seems to perform better escaping of cdata and
    attribute values. Instead of replacing, for example "&quote;" with
    "&quote;" or "&" with "&", it tries to avoid requoting
    ampersands in things that look like entities.

    Sorry, I haven't tested this with anything except Python 2.4, I'm not quite
    sure what to do about _encode_entity, and I haven't patched any tests or
    written a new one for this change. Consider this more of a RFC than a
    patch ready-for-submission as a result.

    @chrism chrism mannequin closed this as completed Feb 4, 2006
    @chrism chrism mannequin closed this as completed Feb 4, 2006
    @chrism chrism mannequin assigned effbot Feb 4, 2006
    @chrism chrism mannequin added the topic-XML label Feb 4, 2006
    @chrism chrism mannequin assigned effbot Feb 4, 2006
    @chrism chrism mannequin added the topic-XML label Feb 4, 2006
    @chrism
    Copy link
    Mannequin Author

    chrism mannequin commented Feb 4, 2006

    Logged In: YES
    user_id=32974

    Sorry, the tracker doesn't seem to want to allow me to upload the file. See
    http://www.plope.com/static/misc/betterescape.patch for the patch.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    OP: You did check the box?

    @chrism
    Copy link
    Mannequin Author

    chrism mannequin commented Feb 4, 2006

    Logged In: YES
    user_id=32974

    Egads, I did this time.

    @effbot
    Copy link
    Mannequin

    effbot mannequin commented Feb 6, 2006

    Logged In: YES
    user_id=38376

    I'm not sure I follow. ET works on the infoset side of
    things, where everything is decoded into Unicode strings (or
    compatible ASCII strings). If you set an attribute to
    "&" in the infoset, it *must* be encoded on the way out.
    If you want an ampersand, use "&".

    @chrism
    Copy link
    Mannequin Author

    chrism mannequin commented Feb 8, 2006

    Logged In: YES
    user_id=32974

    Doh, of course. Sorry, I suspect I'll need to go to remedial XML class. Ignore
    this.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 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

    1 participant