GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-108082: C API: Add tests for PyErr_WriteUnraisable() by serhiy-storchaka · Pull Request #111455 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Oct 29, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Also document the behavior when called with NULL.

  • Issue: [C API] Enhance PyErr_WriteUnraisable() API to pass an error message #108082

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
pythongh-108082: C API: Add tests for PyErr_WriteUnraisable()
93da12c
Also document the behavior when called with NULL.
@serhiy-storchaka
serhiy-storchaka requested a review from vstinner October 29, 2023 11:29
@bedevere-app bedevere-app Bot mentioned this pull request Oct 29, 2023
[C API] Enhance PyErr_WriteUnraisable() API to pass an error message #108082
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 29, 2023
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir docs Documentation in the Doc dir skip news needs backport to 3.12 only security fixes labels Oct 29, 2023
@serhiy-storchaka serhiy-storchaka mentioned this pull request Oct 29, 2023
gh-108082: Add PyErr_FormatUnraisable() function #111086
Merged
@serhiy-storchaka
Remove ".. versionchanged:: 3.2" as insignificant.
1ff4c08
serhiy-storchaka
serhiy-storchaka commented Oct 29, 2023
View reviewed changes
Comment thread Doc/c-api/exceptions.rst
Comment on lines +98 to +99
.. versionchanged:: 3.4
Print a traceback. Print only traceback if *obj* is ``NULL``.

@serhiy-storchaka serhiy-storchaka Oct 29, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

See bpo-7317/#51566.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/exceptions.rst
Comment on lines +101 to +102
.. versionchanged:: 3.8
Use :func:`sys.unraisablehook`.

@serhiy-storchaka serhiy-storchaka Oct 29, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

See bpo-36829/#81010.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/exceptions.rst Outdated
Comment on lines +95 to +96
.. versionchanged:: 3.2
Accept ``NULL`` as argument.

@serhiy-storchaka serhiy-storchaka Oct 29, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actually, it was cosmetic change. It skipped " in <NULL>" if obj is NULL.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vstinner
vstinner approved these changes Oct 30, 2023
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. I just made a minor coding style suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_testcapi/exceptions.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 30, 2023
@serhiy-storchaka @vstinner
Update Modules/_testcapi/exceptions.c
900b74b
Co-authored-by: Victor Stinner <[email protected]>
@serhiy-storchaka

serhiy-storchaka commented Oct 30, 2023

Copy link
Copy Markdown
Member Author

Thank you Victor for your review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
serhiy-storchaka merged commit bca3305 into python:main Oct 30, 2023
@miss-islington-app

miss-islington-app Bot commented Oct 30, 2023

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 30, 2023
@serhiy-storchaka
serhiy-storchaka deleted the test-capi-PyErr_WriteUnraisable branch October 30, 2023 17:01
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 30, 2023
@serhiy-storchaka @miss-islington
pythongh-108082: C API: Add tests for PyErr_WriteUnraisable() (python…
88d383b
…GH-111455)

Also document the behavior when called with NULL.
(cherry picked from commit bca3305)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app

bedevere-app Bot commented Oct 30, 2023

Copy link
Copy Markdown

GH-111507 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 30, 2023
serhiy-storchaka added a commit that referenced this pull request Oct 30, 2023
@miss-islington @serhiy-storchaka
[3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-11…
748bc48
…1455) (GH-111507)

Also document the behavior when called with NULL.
(cherry picked from commit bca3305)

Co-authored-by: Serhiy Storchaka <[email protected]>
FullteaR pushed a commit to FullteaR/cpython that referenced this pull request Nov 3, 2023
@serhiy-storchaka @FullteaR
pythongh-108082: C API: Add tests for PyErr_WriteUnraisable() (python…
4071691
…GH-111455)

Also document the behavior when called with NULL.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@serhiy-storchaka @aisk
pythongh-108082: C API: Add tests for PyErr_WriteUnraisable() (python…
e262ba6
…GH-111455)

Also document the behavior when called with NULL.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@serhiy-storchaka @Glyphack
pythongh-108082: C API: Add tests for PyErr_WriteUnraisable() (python…
a87ec4c
…GH-111455)

Also document the behavior when called with NULL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@serhiy-storchaka @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.