8000 gh-131535: Fix stale example in `html.parser` docs, make examples doctests by brianschubert · Pull Request #131551 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131535: Fix stale example in html.parser docs, make examples doctests #131551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

brianschubert
Copy link
Contributor
@brianschubert brianschubert commented Mar 21, 2025

Fixes #131535

Back in Python 3.5, the default for convert_charrefs was changed from False to True. One of the docs examples still assumes the old default of False. This PR updates the example to reflect the current behavior.

Also migrates the examples to doctests to help catch any further discrepancies. Slightly tweaks two examples to avoid relying on trailing whitespace, which isn't visible in the output and makes doctests tricky.


📚 Documentation preview 📚: https://cpython-previews--131551.org.readthedocs.build/

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.

LGTM. 👍

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 7, 2025
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) May 7, 2025 09:23
@serhiy-storchaka serhiy-storchaka merged commit ee76e36 into python:main May 7, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs May 7, 2025
@miss-islington-app
Copy link

Thanks @brianschubert for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry @brianschubert and @serhiy-storchaka, I had trouble checking out the 3.14 backport branch.
Please retry by removing and re-adding the "needs backport to 3.14" label.
Alternatively, you can backport using cherry_picker on the command line.

cherry_picker ee76e36d76a0e6916c0afc41228b043ab5174685 3.14

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 7, 2025
… doctests (pythonGH-131551)

(cherry picked from commit ee76e36)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented May 7, 2025

GH-133587 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 7, 2025
brianschubert added a commit to brianschubert/cpython that referenced this pull request May 7, 2025
…xamples doctests (pythonGH-131551)

(cherry picked from commit ee76e36)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented May 7, 2025

GH-133589 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 7, 2025
serhiy-storchaka pushed a commit that referenced this pull request May 7, 2025
…s doctests (GH-131551) (GH-133587)

(cherry picked from commit ee76e36)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
serhiy-storchaka pushed a commit that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

html.parser produces different output than documented
2 participants
0