cpython/Lib/xml/etree
Miss Islington (bot) b12dba40ff
gh-91447: Fix findtext to only give an empty string on None (GH-91486)
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 a95e60db74)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
2022-08-01 14:22:33 -07:00
..
ElementInclude.py Update URLs in comments and metadata to use HTTPS (GH-27458) 2021-07-30 15:54:46 +02:00
ElementPath.py gh-91447: Fix findtext to only give an empty string on None (GH-91486) 2022-08-01 14:22:33 -07:00
ElementTree.py gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426) (GH-93793) 2022-07-26 12:20:33 +02:00
__init__.py Update URLs in comments and metadata to use HTTPS (GH-27458) 2021-07-30 15:54:46 +02:00
cElementTree.py bpo-36543: Revert "bpo-36543: Remove the xml.etree.cElementTree module." (GH-20117) 2020-06-10 17:39:12 +02:00