You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
invalid result value of _weakref.__init__() #47884
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:
assignee='https://github.com/benjaminp'closed_at=<Date2008-09-09.20:56:33.433>created_at=<Date2008-08-21.17:25:00.721>labels= ['library']
title='invalid result value of _weakref.__init__()'updated_at=<Date2008-09-09.20:56:33.412>user='https://github.com/vstinner'
I think the test should check that TypeError is actually raised:
self.assertRaises(TypeError, r.__init__, 0, 0, 0, 0, 0)
It's even shorter than the try/except block...
Activity
vstinner commentedon Aug 21, 2008
_weakref.__init__() doesn't catch errors correctly. Example:
--------------------- 8< -------------------------
Attached patch fix the bug for py3k branch: return -1 on error
(instead of 1).
vstinner commentedon Sep 8, 2008
The bug and the fix are trivials. Can anyone review my patch?
benjaminp commentedon Sep 8, 2008
The patch looks absolutely fine to me. (I think I have to have another
core developer look at it too, though.)
pitrou commentedon Sep 9, 2008
Adding a simple unit test would be nice.
vstinner commentedon Sep 9, 2008
Add a test to check to regression.
amauryfa commentedon Sep 9, 2008
I think the test should check that TypeError is actually raised:
self.assertRaises(TypeError, r.__init__, 0, 0, 0, 0, 0)
It's even shorter than the try/except block...
vstinner commentedon Sep 9, 2008
amaury: oh yes, i forget to use assertRaise(). A new patch is
attached.
amauryfa commentedon Sep 9, 2008
Both patches look fine to me.
They could be backported to 2.5 as well.
benjaminp commentedon Sep 9, 2008
Fixed in r66352.