Skip to content

gh-133905: Fix parsing problems in example code#133906

Open
cmarqu wants to merge 2 commits intopython:mainfrom
cmarqu:gh-133905
Open

gh-133905: Fix parsing problems in example code#133906
cmarqu wants to merge 2 commits intopython:mainfrom
cmarqu:gh-133905

Conversation

@cmarqu
Copy link
Copy Markdown
Contributor

@cmarqu cmarqu commented May 11, 2025

Fix problems in documentation example code snippets that prevent them from being parsed.


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

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 11, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Great catch! Thank you!

We should totally add some plugin to parse our examples in the docs.

Comment thread Doc/faq/programming.rst Outdated
Comment thread Doc/library/inspect.rst Outdated
Comment thread Doc/library/logging.rst Outdated
Comment thread Doc/library/test.rst Outdated
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Looks much better to me! Let's wait for other opinions :)

Copy link
Copy Markdown
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

I'm not sure about this. Some of these clearly read better to me without the changes in this PR. I'm also hesistant that the motivation here is just to introduce a third party tool, whereas that tool could just be made more resilient.

A

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 12, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@cmarqu
Copy link
Copy Markdown
Contributor Author

cmarqu commented May 12, 2025

The sphinx-codeautolink extension is resilient, but it will not put links in these unparseable code snippets.
The warnings it would produce by default can be handled easily with Sphinx' suppress_warnings.

Comment thread Doc/howto/ipaddress.rst Outdated
Comment on lines +257 to +258
# do something
...
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.

I would prefer a single line here and for most of the examples. Could do the revision with sed.

Suggested change
# do something
...
... # do something

Copy link
Copy Markdown
Contributor Author

@cmarqu cmarqu May 14, 2025

Choose a reason for hiding this comment

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

Oops, there was indeed one such occurrence left, fixed. A follow-up PR could reformat all the examples consistently; this PR only works on the places where there were parsing problems.

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants