| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-115623) (GH-116275)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`
Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .
Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
| |
(cherry picked from commit 51a85ddce8b336addcb61b96f04c9c5edef07296)
Co-authored-by: Alex Prengère <2138730+alexprengere@users.noreply.github.com>
|
| |
|
|
|
| |
default namespace was defined. (GH-22474) (GH-22508)
(cherry picked from commit 6a412c94b6b68e7e3632562dc7358a12ffd1447f)
|
| |
|
|
|
|
|
| |
* Implement C14N 2.0 as a new canonicalize() function in ElementTree.
Missing features:
- prefix renaming in XPath expressions (tag and attribute text is supported)
- preservation of original prefixes given redundant namespace declarations
|
| |
|
|
|
| |
target (GH-12885)
* bpo-36676: Implement namespace prefix aware parsing support for the XMLParser target in ElementTree.
|
| |
|
|
|
|
|
|
| |
ElementTree. (#12883)
* bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree.
* bpo-36673: Rewrite the comment/PI factory handling for the TreeBuilder in "_elementtree" to make it use the same factories as the ElementTree module, and to make it explicit when the comments/PIs are inserted into the tree and when they are not (which is the default).
|
| |
|
|
|
| |
arguments (GH-12225)
Add new keyword arguments "default_namespace" and "xml_declaration" to functions ET.tostring() and ET.tostringlist(), as known from ElementTree.write().
|
| | |
|
| |
|
|
| |
(GH-10190)
|
| | |
|
| |
|
|
|
|
| |
It is now guarantied that children of xml.etree.ElementTree.Element
are Elements (at least in C implementation). Previously methods
__setitem__(), __setstate__() and __deepcopy__() could be used for
adding non-Element children.
|
| |
|
|
|
| |
Also make getchildren() and getiterator() emitting
a DeprecationWarning instead of PendingDeprecationWarning.
|
| |
|
|
|
|
|
|
| |
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py
|
| |
|
|
| |
collections. (#1263)
|
| |
|
|
|
|
|
|
| |
Element.getiterator() and the html parameter of XMLParser() were
deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly).
Now using them emits a deprecation warning.
* Don’t need check_warnings any more.
|
| |\ |
|
| | |
| |
| |
| | |
(Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
|
| | |
| |
| |
| |
| |
| |
| | |
And most of the tools.
Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
|
| |
ElementTree.XMLParser._setevents now accepts any objects with the append
method, not just a list.
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| | |
This restores the ability to write encoding names in uppercase like "UTF-8",
which worked in Python 2.
|
| | |
| |
| |
| | |
implementation in issue #21408 they are redundant.
|
| |\ \
| |/ |
|
| | | |
|
| |/
|
|
| |
class name instead of hardcoded one.
|
| |
|
|
|
|
|
|
|
|
| |
I was confused by the text saying that read_events "iterated", since it
actually returns an iterator (that's what a generator does) that the
caller must then iterate. So I tidied up the language. I'm not sure
what the sentence "Events provided in a previous call to read_events()
will not be yielded again." is trying to convey, so I didn't try to fix that.
Also fixed a couple more news items.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- this was an internal implementation detail for iterparse
- this has been changed to use a new private method instead
- XMLPullParser.close docs are now more explicit about not
returning a root element and instead direct users towards
read_events
- also added missing docstrings and clarified some details
related to exactly *when* events are consumed from the
internal queue
(Initial patch by Stefan Behnel)
|
| |
|
|
|
|
| |
The new names are hopefully more descriptive and consistent. If you feel you
don't agree with this change, *please* read issue 17741 first - there's a lot of
discussion in there.
|
| |
|
|
|
| |
XMLParser configures expat to report attributes in a list (ordered_attributes),
so only _start_list is needed. Rename it to _start and kill _start.
|
| |
|
|
|
|
| |
xml.etree.iterparse's result class.
Patch by Stefan Behnel.
|
| |\ |
|
| | | |
|
| |\ \
| |/
| |
| | |
closing tags.
|
| | |
| |
| |
| | |
closing tags.
|
| | |\ |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
ModuleNotFoundError.
|
| | | |
| | |
| | |
| | |
| | | |
is imported. Instead, ElementTree.parse can look for a special internal method
defined by the accelerator.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Renaming to _Element_Py for clarity and moving it to a more logical location.
_ElementInterface OTOH is unused and is therefore removed.
Close #17988
|