cpython/Misc/NEWS.d/next/Library/2022-04-12-18-05-40.gh-issue-91447.N_Fs4H.rst
Eugene Triguba a95e60db74
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.html#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 #91447.

Automerge-Triggered-By: GH:gvanrossum
2022-08-01 09:52:39 -07:00

2 lines
100 B
ReStructuredText

Fix findtext in the xml module to only give an empty string when the text
attribute is set to None.