This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年08月21日 17:25 by vstinner, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| weakref_init.patch | vstinner, 2008年08月21日 17:25 | Fix weakref___init__() return value: -1 on error | ||
| weakref_test-2.patch | vstinner, 2008年09月09日 09:44 | Test <weakref to class>.__init__() using assertRaise() | ||
| Messages (9) | |||
|---|---|---|---|
| msg71662 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2008年08月21日 17:25 | |
_weakref.__init__() doesn't catch errors correctly. Example: --------------------- 8< ------------------------- 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 (instead of 1). |
|||
| msg72809 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2008年09月08日 23:45 | |
The bug and the fix are trivials. Can anyone review my patch? |
|||
| msg72811 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年09月08日 23:58 | |
The patch looks absolutely fine to me. (I think I have to have another core developer look at it too, though.) |
|||
| msg72812 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年09月09日 00:17 | |
Adding a simple unit test would be nice. |
|||
| msg72830 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2008年09月09日 08:17 | |
Add a test to check to regression. |
|||
| msg72833 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年09月09日 09:20 | |
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... |
|||
| msg72835 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2008年09月09日 09:45 | |
amaury: oh yes, i forget to use assertRaise(). A new patch is attached. |
|||
| msg72842 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2008年09月09日 11:20 | |
Both patches look fine to me. They could be backported to 2.5 as well. |
|||
| msg72909 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年09月09日 20:56 | |
Fixed in r66352. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:38 | admin | set | github: 47884 |
| 2008年09月09日 20:56:33 | benjamin.peterson | set | status: open -> closed resolution: accepted -> fixed messages: + msg72909 |
| 2008年09月09日 11:20:24 | amaury.forgeotdarc | set | keywords:
- needs review resolution: accepted messages: + msg72842 |
| 2008年09月09日 09:45:03 | vstinner | set | messages: + msg72835 |
| 2008年09月09日 09:44:16 | vstinner | set | files: - weakref_test.patch |
| 2008年09月09日 09:44:12 | vstinner | set | files: + weakref_test-2.patch |
| 2008年09月09日 09:20:55 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg72833 |
| 2008年09月09日 08:17:46 | vstinner | set | files:
+ weakref_test.patch messages: + msg72830 |
| 2008年09月09日 00:17:42 | pitrou | set | nosy:
+ pitrou messages: + msg72812 |
| 2008年09月08日 23:58:14 | benjamin.peterson | set | keywords:
+ needs review assignee: benjamin.peterson messages: + msg72811 nosy: + benjamin.peterson |
| 2008年09月08日 23:45:45 | vstinner | set | messages: + msg72809 |
| 2008年08月26日 00:53:31 | ajaksu2 | set | nosy: + ajaksu2 |
| 2008年08月21日 17:25:00 | vstinner | create | |