GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-149489: Fix ElementTree serialization to HTML by serhiy-storchaka · Pull Request #149490 · python/cpython Conversation
|
|
Updating to fix some errors we introduced on the main branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not done with the review yet, but I find it risky to silently change output in a point release like 3.1[34].x. If we change this, it's probably still fine for 3.15, but I'd rather see the maintenance releases excluded. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Well, the fix for XML was applied to 2.7 and 3.2 and was not backported to 2.6 and 3.1. It introduces a risk of XML/HTML injection if the comment content was not previously sanitized. See #149468. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Well, yes. If we remove the current escaping, then we leave user code unprotected. Definitely not something that users should expect from a point release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Test failures are related to #149571. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
'<spam> & ham', 'ham & eggs < spam', '<spam>&ham')?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Ezio Melotti <[email protected]>
There was an error while loading. Please reload this page.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-150592 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-150593 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-150594 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* The content of comments, processing instructions and elements "xmp", "iframe", "noembed", "noframes", and "plaintext" is no longer escaped. * The "plaintext" element no longer have the closing tag. * Add support of empty attributes (with value None). (cherry picked from commit bcd29e4) Co-authored-by: Serhiy Storchaka <[email protected]>
|
Sorry @serhiy-storchaka, I had trouble completing the backport. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* The content of comments, processing instructions and elements "xmp", "iframe", "noembed", "noframes", and "plaintext" is no longer escaped. * The "plaintext" element no longer have the closing tag. * Add support of empty attributes (with value None). (cherry picked from commit bcd29e4) Co-authored-by: Serhiy Storchaka <[email protected]>
|
Sorry @serhiy-storchaka, I had trouble completing the backport. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-150595 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…GH-149490) (pythonGH-150595) * The content of elements "xmp", "iframe", "noembed", "noframes", and "plaintext" is no longer escaped. * The "plaintext" element no longer have the closing tag. (cherry picked from commit bcd29e4) Co-authored-by: Serhiy Storchaka <[email protected]>
…GH-149490) * The content of elements "xmp", "iframe", "noembed", "noframes", and "plaintext" is no longer escaped. * The "plaintext" element no longer have the closing tag. (cherry picked from commit bcd29e4) Co-authored-by: Serhiy Storchaka <[email protected]>
|
GH-150596 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…H-150596) (GH-150609) * The content of elements "xmp", "iframe", "noembed", "noframes", and "plaintext" is no longer escaped. * The "plaintext" element no longer have the closing tag. (cherry picked from commit c42e6d3) (cherry picked from commit bcd29e4) Co-authored-by: Serhiy Storchaka <[email protected]>
| if tag is Comment: | ||
| write("<!--%s-->" % _escape_cdata(text)) | ||
| write("<!--%s-->" % text) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit late to the party, but what happens if text contains -->? Shouldn't this be escaped (if there's a way to escape it, I don't think so 🤔) or probably instead be rejected altogether?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| write("<!--%s-->" % text) | ||
| elif tag is ProcessingInstruction: | ||
| write("<?%s?>" % _escape_cdata(text)) | ||
| write("<?%s?>" % text) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I guess same question here -- what if text contains ?>?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, that was my concern in #149490 (comment) as well. Note that this part of the changes was not backported and will only appear in 3.15+. The HTML5 spec is explicit about what is not allowed in comments: It's not clear about what is allowed in processing instructions, but that probably just means that I think it's worth rejecting non well-formed text. lxml does it in the API when creating a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.