Skip to content

gh-139837: document attributes of objects recorded by warnings.catch_warnings#139893

Merged
serhiy-storchaka merged 9 commits into
python:mainfrom
Aniketsy:doc-warnings-warningmessage-attrs
Jun 14, 2026
Merged

gh-139837: document attributes of objects recorded by warnings.catch_warnings#139893
serhiy-storchaka merged 9 commits into
python:mainfrom
Aniketsy:doc-warnings-warningmessage-attrs

Conversation

@Aniketsy

@Aniketsy Aniketsy commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

#139837

This PR updates the documentation for :func:warnings.catch_warnings:

  • Explicitly lists the attributes guaranteed to be present on each recorded object.
  • Corrects the note to say output is suppressed to sys.stderr.

Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thankyou !


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

@Aniketsy

Copy link
Copy Markdown
Contributor Author

@StanFromIreland Please review these changes when you get a chance.

@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 30, 2026
@serhiy-storchaka serhiy-storchaka requested a review from vstinner June 2, 2026 17:19
@serhiy-storchaka

Copy link
Copy Markdown
Member

@vstinner, could you please review this PR?

@read-the-docs-community

read-the-docs-community Bot commented Jun 2, 2026

Copy link
Copy Markdown

Comment thread Doc/library/warnings.rst Outdated
Comment thread Doc/library/warnings.rst Outdated
Comment thread Doc/library/warnings.rst Outdated
Aniketsy and others added 2 commits June 3, 2026 16:59
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
@Aniketsy

Aniketsy commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@vstinner thanks for the review and suggestion, i've applied changes, please let me know if we need any further improvements.

@Aniketsy

Aniketsy commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

i think by updating branch, this ci fail will be green .

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jun 8, 2026
@Aniketsy

Copy link
Copy Markdown
Contributor Author

@vstinner gentle ping, in this also 😀 , i think we're ready for this also please let me know your thoughts.

@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.

You have not added module.

@Aniketsy

Copy link
Copy Markdown
Contributor Author

You have not added module.

ah sorry 😿 i missed .

Comment thread Doc/library/warnings.rst Outdated

@vstinner vstinner 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. Maybe just reformat to fit into 80 columns.

Comment thread Doc/library/warnings.rst Outdated
@Aniketsy

Copy link
Copy Markdown
Contributor Author

LGTM. Maybe just reformat to fit into 80 columns.

thanks, i've update the format to fit .

@Aniketsy

Copy link
Copy Markdown
Contributor Author

ci fails looks unrelated

@vstinner

Copy link
Copy Markdown
Member

ci fails looks unrelated

Docs/Docs CI failed with "fatal: shallow file has changed since we read it": that's #151365. Re-run the job should be enough to workaround the Git regression.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 14, 2026
@serhiy-storchaka serhiy-storchaka merged commit 47b7dc7 into python:main Jun 14, 2026
55 of 57 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 14, 2026
@miss-islington-app

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Jun 14, 2026

Copy link
Copy Markdown

GH-151472 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 14, 2026
@bedevere-app

bedevere-app Bot commented Jun 14, 2026

Copy link
Copy Markdown

GH-151473 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 Jun 14, 2026
serhiy-storchaka pushed a commit that referenced this pull request Jun 14, 2026
….catch_warnings (GH-139893) (GH-151472)

(cherry picked from commit 47b7dc7)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Jun 15, 2026
….catch_warnings (GH-139893) (#151473)

* gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)
(cherry picked from commit 47b7dc7)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

* Apply suggestions from code review

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

---------

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
vstinner added a commit that referenced this pull request Jun 15, 2026
….catch_warnings (GH-139893) (GH-151473) (#151494)

[3.14] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (GH-151473)

* gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)
(cherry picked from commit 47b7dc7)




* Apply suggestions from code review



---------
(cherry picked from commit eb612f4)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.

4 participants