Skip to content

Conversation

@eugenetriguba
Copy link
Contributor

@eugenetriguba eugenetriguba commented Apr 12, 2022

The API documentation for 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

The API documentation for it states that this function gives back an empty string on "no text content." With the previous implementation, this would give back an emtpy string even on text content values such as 0 or False. This attempts to resolve that by only giving back an empty string if the text attribute is set to None.
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove redundant empty lines.

@eugenetriguba
Copy link
Contributor Author

@serhiy-storchaka This is in reference to line 419 and line 422?

@eugenetriguba
Copy link
Contributor Author

Are you also referring to line 2742 and line 2751?

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After considering it more I think this is fine. I don't think we should merge into 3.11 though, we're too close to RC1.

@miss-islington
Copy link
Contributor

Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit a95e60d into python:main Aug 1, 2022
@gvanrossum
Copy link
Member

@pablogsal Do you recommend backporting this to 3.11? It's been like that forever, so it doesn't strike me as urgent. If not to 3.11, would it go into 3.11.1 or stay in 3.12?

@pablogsal
Copy link
Member

pablogsal commented Aug 1, 2022

@pablogsal Do you recommend backporting this to 3.11?

Thanks for checking with me! Yeah, I think is ok to backport to 3.11 given that is a small fix that's fixing an existing bug. But please, let's do it before rc1 :)

@gvanrossum gvanrossum added 3.12 only security fixes needs backport to 3.11 only security fixes labels Aug 1, 2022
@miss-islington
Copy link
Contributor

Thanks @eugenetriguba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 1, 2022
@bedevere-bot
Copy link

GH-95543 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 1, 2022
…thonGH-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 pythonGH-91447. Automerge-Triggered-By: GH:gvanrossum (cherry picked from commit a95e60d) Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
miss-islington added a commit that referenced this pull request Aug 1, 2022
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 a95e60d) Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
@eugenetriguba eugenetriguba deleted the fix/91447-xml-findtext branch August 4, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.12 only security fixes

6 participants