Issue 2542: PyErr_ExceptionMatches must not fail
Created on 2008-04-03 08:58 by theller, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| errors.diff | theller, 2008-04-03 08:58 | |||
| test_exceptions.diff | ajaksu2, 2008-04-03 15:51 | |||
| Messages (9) | |||
|---|---|---|---|
| msg64894 - (view) | Author: Thomas Heller (theller) * ![]() |
Date: 2008-04-03 08:58 | |
PyErr_ExceptionMatches must not fail, according to the docs. So an error code from PyObject_IsSubclass() cannot be returned. The attached patch calls PyErr_WriteUnraisable in this case, and returns an arbitrary value (0 was chosen in the patch). See also issue #2534. |
|||
| msg64899 - (view) | Author: Daniel Diniz (ajaksu2) * ![]() |
Date: 2008-04-03 15:51 | |
The tests pass and prints the ignores. But I still see an issue:
import sys
def g():
try:
return g()
except:
return sys.exc_info()
>>> g()
(<type 'exceptions.RuntimeError'>, 'maximum recursion depth exceeded
while calling a Python object', <traceback object at 0xb7d3d75c>)
>>> import sys
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded
Then, I can raise that RuntimeError and clear things:
>>> sys.excepthook(*g())
Traceback (most recent call last):
File "<stdin>", line 3, in g
RuntimeError: maximum recursion depth exceeded while calling a Python object
>>> import sys
>>>
The attached patch adds a test for this condition, I hope someone more
test-savvy than I can review it.
|
|||
| msg64921 - (view) | Author: Thomas Heller (theller) * ![]() |
Date: 2008-04-04 08:17 | |
Daniel, IMO you've found a separate bug. I added it as issue #2548. |
|||
| msg68003 - (view) | Author: Barry A. Warsaw (barry) * ![]() |
Date: 2008-06-11 18:09 | |
This is a bug, not a new feature so it's not release critical for the first alphas. |
|||
| msg69486 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2008-07-09 21:10 | |
FWIW some comments by Amaury are here: http://codereview.appspot.com/483 |
|||
| msg70418 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2008-07-30 04:19 | |
Ping? Anyone cares about this? |
|||
| msg70420 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2008-07-30 09:38 | |
I am working on Thomas' patch, plus tests. |
|||
| msg70450 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2008-07-31 01:21 | |
Committed r65320 in trunk. I'll close the issue after it is merged into py3k. |
|||
| msg70452 - (view) | Author: Benjamin Peterson (benjamin.peterson) * ![]() |
Date: 2008-07-31 01:47 | |
I just merged it. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:32 | admin | set | github: 46794 |
| 2008-07-31 01:47:25 | benjamin.peterson | set | status: pending -> closed nosy: + benjamin.peterson messages: + msg70452 keywords: patch, patch |
| 2008-07-31 01:21:12 | amaury.forgeotdarc | set | status: open -> pending resolution: fixed messages: + msg70450 keywords: patch, patch |
| 2008-07-30 09:38:47 | amaury.forgeotdarc | set | keywords:
patch, patch assignee: amaury.forgeotdarc messages: + msg70420 nosy: + amaury.forgeotdarc |
| 2008-07-30 04:19:40 | gvanrossum | set | keywords:
patch, patch messages: + msg70418 |
| 2008-07-28 17:05:42 | benjamin.peterson | set | priority: critical -> release blocker keywords: patch, patch |
| 2008-07-13 18:54:47 | gregory.p.smith | link | issue2534 dependencies |
| 2008-07-09 21:10:15 | gvanrossum | set | keywords:
patch, patch nosy: + gvanrossum messages: + msg69486 |
| 2008-06-11 18:09:41 | barry | set | priority: release blocker -> critical nosy: + barry messages: + msg68003 keywords: patch, patch |
| 2008-05-13 08:39:00 | georg.brandl | set | priority: release blocker keywords: patch, patch |
| 2008-04-04 08:17:23 | theller | set | keywords:
patch, patch messages: + msg64921 |
| 2008-04-03 15:51:13 | ajaksu2 | set | files:
+ test_exceptions.diff nosy: + ajaksu2 messages: + msg64899 |
| 2008-04-03 08:58:59 | theller | create | |

