Skip to content

bpo-36203: Check callback is callable in PyWeakref_NewRef#26273

Closed
tekknolagi wants to merge 2 commits into
python:mainfrom
tekknolagi:main
Closed

bpo-36203: Check callback is callable in PyWeakref_NewRef#26273
tekknolagi wants to merge 2 commits into
python:mainfrom
tekknolagi:main

Conversation

@tekknolagi

@tekknolagi tekknolagi commented May 20, 2021

Copy link
Copy Markdown
Contributor

The documentation says that PyWeakref_NewRef should raise a
TypeError if the callback is not callable, None, or NULL, but the code
does not reflect the documentation. This PR fixes that.

This should probably be backported to whatever version of Python
changed that documentation.

https://bugs.python.org/issue36203

The documentation says that `PyWeakref_NewRef` should raise a
`TypeError` if the callback is not callable, None, or NULL, but the code
does not reflect the documentation. This PR fixes that.
@tekknolagi tekknolagi changed the title Check callback is callable in PyWeakref_NewRef bpo-36203: Check callback is callable in PyWeakref_NewRef May 20, 2021
@tekknolagi

Copy link
Copy Markdown
Contributor Author

Tests failing seem entirely unrelated

@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 Jun 21, 2021
@tekknolagi

Copy link
Copy Markdown
Contributor Author

bump? :)

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Runs ok on my Ubuntu.

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

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

This has merge conflicts now.

@bedevere-bot

Copy link
Copy Markdown

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.

@ghost

ghost commented Dec 17, 2022

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@@ -0,0 +1 @@
Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Amend PyWeakref_New to raise a TypeError if the callback given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred.
Amend :c:func:`PyWeakref_New` to raise :exc:`TypeError` if the *callback* given is not NULL, None, or a callable object. The documentation previously falsely claimed this check occurred.

@python-cla-bot

python-cla-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@github-actions

github-actions Bot commented Apr 9, 2026

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 9, 2026
@tekknolagi

Copy link
Copy Markdown
Contributor Author

I regrettably have no time to work on this. Please feel free to take over or close as appropriate.

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 10, 2026
@serhiy-storchaka serhiy-storchaka self-requested a review June 4, 2026 13:52
@serhiy-storchaka

Copy link
Copy Markdown
Member

Superseded by #151145.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants