Skip to content

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

Merged
serhiy-storchaka merged 4 commits into
python:mainfrom
brianschubert:gh-131535-docs-html-parser
May 7, 2025
Merged

serhiy-storchaka merged 4 commits into
python:mainfrom
brianschubert:gh-131535-docs-html-parser

Conversation

@brianschubert

@brianschubert brianschubert commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor

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/

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. 👍

Comment thread Doc/library/html.parser.rst Resolved
@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
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs May 7, 2025
@miss-islington-app

Copy link
Copy Markdown

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
Copy Markdown

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

bedevere-app Bot commented May 7, 2025

Copy link
Copy Markdown

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 only 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

bedevere-app Bot commented May 7, 2025

Copy link
Copy Markdown

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
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@serhiy-storchaka serhiy-storchaka removed their assignment Jul 15, 2026
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