[issue4589] 'with' loses ->bool exceptions

2008-12-10 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Fixed with r67684 (2.5), r67688 (trunk), r67689 (py3k), r67690 (3.0), r67691 (2.6). -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue4589] 'with' loses ->bool exceptions

2008-12-09 Thread Jeffrey Yasskin
Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment: It's a corner case that would confuse anyone who ran into it, so I'm happy to backport it. I'll probably just re-do your patch on the 2.5 branch since WITH_CLEANUP has a different structure there. ___ Pyth

[issue4589] 'with' loses ->bool exceptions

2008-12-09 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > Does it need to be backported to 2.5? IMO it is a corner case. Not necessarily. If nobody volunteers, it won't be backported, which is fine with me. The only potential release blocker for a bug fix release can be a regression, which this i

[issue4589] 'with' loses ->bool exceptions

2008-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Does it need to be backported to 2.5? IMO it is a corner case. ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4589] 'with' loses ->bool exceptions

2008-12-09 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: The patch doesn't apply cleanly to the 2.5 branch, because that doesn't have r61290. If somebody wants to backport it, go ahead (if you can do so by Thursday). -- nosy: +loewis ___ Python tracker

[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Kevin Watters
Changes by Kevin Watters <[EMAIL PROTECTED]>: -- nosy: +kevinwatters ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mai

[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Jeffrey Yasskin
Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment: Looks good. Thanks! I assume this should be merged into the 2.6.x and 3.0.x branches? ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Running the test with -R:: indeed shows the reference leak. 2nd patch with suggested corrections. -- assignee: jyasskin -> amaury.forgeotdarc Added file: http://bugs.python.org/file12285/with_badbool_2.patch ___

[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Jeffrey Yasskin
Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment: I think your patch leaks a reference to 'x'. Move the Py_DECREF(x) to before "if (err < 0)"? And then really nitpicky: your test has 3 blank lines after it, and should have 2. Otherwise looks great. Thanks for picking this up! -- k

[issue4589] 'with' loses ->bool exceptions

2008-12-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Good catch. Here is a patch, with test. -- keywords: +needs review, patch nosy: +amaury.forgeotdarc priority: -> normal stage: needs patch -> patch review Added file: http://bugs.python.org/file12280/with_badbool.patch ___

[issue4589] 'with' loses ->bool exceptions

2008-12-07 Thread Jeffrey Yasskin
New submission from Jeffrey Yasskin <[EMAIL PROTECTED]>: When a context manager's __exit__() method returns an object whose conversion to bool raises an exception, 'with' loses that exception. For example: >>> class CM(object): ... def __init__(self, exit_result): ... self.exit_result = ex