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年03月29日 14:28 by pitrou, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| exc_cleanup.patch | pitrou, 2008年03月29日 14:35 | |||
| exc_cleanup2.patch | pitrou, 2008年03月29日 23:23 | |||
| exc_cleanup3.patch | pitrou, 2008年05月02日 20:27 | |||
| exc_cleanup4.patch | pitrou, 2008年05月07日 22:41 | |||
| better_exc_cleanup.patch | pitrou, 2008年05月24日 22:35 | |||
| Messages (18) | |||
|---|---|---|---|
| msg64697 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年03月29日 14:28 | |
See http://mail.python.org/pipermail/python-3000/2008-March/012830.html : the exception state can survive across thread switches if the enclosing frame is not destroyed immediately. |
|||
| msg64698 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年03月29日 14:35 | |
And this is a patch, together with a test. |
|||
| msg64734 - (view) | Author: Jeffrey Yasskin (jyasskin) * (Python committer) | Date: 2008年03月29日 22:50 | |
Thanks for the patch. This isn't specific to threads at all, so the test doesn't need to spawn a thread, just raise an exception from a nested function with a parameter, catch it, delete the object the parameter referred to, and then check that the object has been destroyed. I don't know the exception handling code very well, so I'd like someone more familiar with it to check that the patch is correct and efficient. Collin, would you do the honors? |
|||
| msg64736 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年03月29日 23:23 | |
You are right, threads aren't needed. So, attaching an updated patch. |
|||
| msg64883 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2008年04月02日 22:03 | |
Knocking the priority down to critical for the next alpha release. This can be readdressed once the release is made. |
|||
| msg66108 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月02日 20:27 | |
A new patch with just an updated comment in ceval.c. |
|||
| msg66344 - (view) | Author: Collin Winter (collinwinter) * (Python committer) | Date: 2008年05月06日 23:26 | |
Looks good to me. Antoine, do you have commit privileges? |
|||
| msg66353 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月07日 08:10 | |
No, I don't. |
|||
| msg66379 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月07日 22:41 | |
Here is a last patch fixing without lines longer than 78 chars. |
|||
| msg66403 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2008年05月08日 04:26 | |
r62847 |
|||
| msg66793 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月13日 19:06 | |
This bug should be reopened, the patch does not fix it when the except clause does not assign the exception to a local variable (that is, "except KeyError" rather than "except KeyError as e"). Another can of worms also appeared in #2833... |
|||
| msg67291 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月24日 11:04 | |
This is a complementary patch that should fix the remaining cases (funnily doctest was relying on the old behaviour). Unfortunately #2833 still remains, and would probably need some discussion on the ML for proper resolution. |
|||
| msg67293 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年05月24日 12:27 | |
For time being, should r62847 be reverted? |
|||
| msg67296 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月24日 12:53 | |
I don't think so. As Amaury pointed in #2833, the original re-raising behaviour which got changed by fixing the present bug was rather broken in its own way. Anyway, I think the question better be asked on the ML because any solution for the re-raising behaviour will require some significant trickery in the compiler and the eval loop. |
|||
| msg67301 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月24日 14:01 | |
Patch removed, there are still some unsolved cases :-) |
|||
| msg67311 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年05月24日 22:35 | |
Here is a hopefully complete patch using the same approach as before. However I'm now convinced that another approach would be better in order to solve both this bug and the various re-raising issues. It would involve replacing most of the set_exc_info() / reset_exc_info() mechanism in ceval.c with something different, probably based on saving/restoring exception state values onto/from the frame stack. Problem is, I'm not sure I'll have time for it very soon. |
|||
| msg67599 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年06月01日 20:05 | |
A clean solution is now proposed in #3021. |
|||
| msg67990 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月11日 16:04 | |
Solved by r64121. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:32 | admin | set | github: 46759 |
| 2008年06月11日 16:04:10 | benjamin.peterson | set | status: open -> closed resolution: fixed messages: + msg67990 |
| 2008年06月01日 21:33:06 | benjamin.peterson | set | superseder: Lexical exception handlers |
| 2008年06月01日 20:05:05 | pitrou | set | messages: + msg67599 |
| 2008年05月30日 20:33:14 | Rhamphoryncus | set | nosy: + Rhamphoryncus |
| 2008年05月24日 22:35:29 | pitrou | set | files:
+ better_exc_cleanup.patch messages: + msg67311 |
| 2008年05月24日 14:01:45 | pitrou | set | messages: + msg67301 |
| 2008年05月24日 14:00:17 | pitrou | set | files: - better_exc_cleanup.patch |
| 2008年05月24日 12:53:13 | pitrou | set | messages: + msg67296 |
| 2008年05月24日 12:27:08 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg67293 |
| 2008年05月24日 11:04:26 | pitrou | set | files:
+ better_exc_cleanup.patch messages: + msg67291 |
| 2008年05月13日 19:18:16 | collinwinter | set | status: closed -> open assignee: collinwinter -> resolution: fixed -> (no value) |
| 2008年05月13日 19:06:17 | pitrou | set | messages: + msg66793 |
| 2008年05月08日 04:26:58 | barry | set | status: open -> closed resolution: fixed messages: + msg66403 priority: release blocker -> critical |
| 2008年05月07日 22:41:25 | pitrou | set | files:
+ exc_cleanup4.patch messages: + msg66379 |
| 2008年05月07日 08:11:05 | pitrou | set | messages: + msg66353 |
| 2008年05月06日 23:26:07 | collinwinter | set | messages: + msg66344 |
| 2008年05月03日 07:07:30 | georg.brandl | set | priority: critical -> release blocker |
| 2008年05月02日 20:27:37 | pitrou | set | files:
+ exc_cleanup3.patch messages: + msg66108 |
| 2008年04月02日 22:03:56 | barry | set | priority: release blocker -> critical nosy: + barry messages: + msg64883 |
| 2008年03月29日 23:23:46 | pitrou | set | files:
+ exc_cleanup2.patch messages: + msg64736 |
| 2008年03月29日 22:50:56 | jyasskin | set | assignee: collinwinter messages: + msg64734 nosy: + collinwinter |
| 2008年03月29日 18:12:09 | christian.heimes | set | priority: release blocker |
| 2008年03月29日 14:35:21 | pitrou | set | files:
+ exc_cleanup.patch keywords: + patch messages: + msg64698 |
| 2008年03月29日 14:28:37 | pitrou | create | |