New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invalid result value of _weakref.__init__() #47884
Comments
_weakref.__init__() doesn't catch errors correctly. Example: from gc import collect
import _weakref
class FuzzingUserClass:
pass
obj = _weakref.ref(FuzzingUserClass)
# Exception not raised??
obj.__init__(
0,
0,
0,
)
# Exception catched here??
collect()
--------------------- 8< Attached patch fix the bug for py3k branch: return -1 on error |
The bug and the fix are trivials. Can anyone review my patch? |
The patch looks absolutely fine to me. (I think I have to have another |
Adding a simple unit test would be nice. |
Add a test to check to regression. |
I think the test should check that TypeError is actually raised: |
amaury: oh yes, i forget to use assertRaise(). A new patch is |
Both patches look fine to me. |
Fixed in r66352. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: