| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
The API documentation for [findtext](https://docs.python.org/3/library/xml.etree.elementtree.htmlGH-xml.etree.ElementTree.Element.findtext) states that this function gives back an empty string on "no text content." With the previous implementation, this would give back a empty string even on text content values such as 0 or False. This patch attempts to resolve that by only giving back an empty string if the text attribute is set to `None`. Resolves GH-91447.
Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit a95e60db748ec6f2c19b5710c11f62e1e4d669f4)
Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
encoding='unicode' (GH-93426) (GH-93793)
Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.
If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.
(cherry picked from commit d7db9dc3cc5b44d0b4ce000571fecf58089a01ec)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
declaration (GH-91903) (GH-92663)
ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
(cherry picked from commit 707839b0fe02ba2c891a40f40e7a869d84c2c9c5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Automerge-Triggered-By: GH:serhiy-storchaka
|
| |
|
| |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
empty tags (GH-31406)
See https://html.spec.whatwg.org/multipage/syntax.html#void-elements
for reference.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
(GH-22987)
|
| | |
|
| |
|
|
| |
default namespace was defined. (GH-22474)
|
| |
|
|
|
|
|
| |
(GH-20117)
* Revert "bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)"
This reverts commit b33e52511a59c6da7132c226b7f7489b092a33eb.
|
| |
|
|
|
|
|
| |
* bpo-39011: Preserve line endings within attributes
Line endings within attributes were previously normalized to "\n" in Py3.7/3.8.
This patch removes that normalization, as line endings which were
replaced by entity numbers should be preserved in original form.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(#5723)
* bpo-20928: bring elementtree's XInclude support en-par with the implementation in lxml by adding support for recursive includes and a base-URL.
* bpo-20928: Support xincluding the same file multiple times, just not recursively.
* bpo-20928: Add 'max_depth' parameter to xinclude that limits the maximum recursion depth to 6 by default.
* Add news entry for updated ElementInclude support
|
| |
|
|
| |
copy.copy() (GH-12995)
|
| | |
|
| |
|
|
|
| |
Remove methods Element.getchildren(), Element.getiterator() and
ElementTree.getiterator() and the xml.etree.cElementTree module.
|
| |
|
|
| |
XML trees (GH-15200)
|
| |
|
|
|
| |
ElementPath. (#13201)
Also provide better grouping of the tokenizer tests.
|
| |
|
|
| |
ElementPath, and extend the surrounding tests and docs. (GH-12997)
|
| |
|
|
|
|
|
| |
* 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).
|
| |
|
|
| |
ElementPath from None to '' since there is existing code that uses that and it's more convenient to have an all-string-keys dict (e.g. when sorting items etc.). (#12860)
|
| |
|
|
| |
they might actually be harmless and unused (and thus went undetected previously). (#12830)
|
| |
|
|
| |
as prefix (#1823)
|
| |
|
|
|
| |
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
|
| | |
|
| |
|
|
|
| |
* Allow whitespace inside of ElementPath predicates.
* Add ElementPath predicate support for text comparison of the current node, like "[.='text']".
|
| |
|
|
| |
collections. (#1263)
|
| |
|
| |
This hides unwanted implementation details from tracebacks.
|
| |
|
|
|
|
|
|
| |
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.
|
| |\ |
|
| | | |
|