[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-16 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8d6155ee9d1b05946f951d0ba602b9f63810fe0f by Irit Katriel in 
branch 'main':
bpo-45635: Do not suppress errors in functions called from _PyErr_Display 
(GH-30073)
https://github.com/python/cpython/commit/8d6155ee9d1b05946f951d0ba602b9f63810fe0f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-12 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28295
pull_request: https://github.com/python/cpython/pull/30073

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-10 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 0fe104fce7da709edddb701baa2249e3275db1fd by Irit Katriel in 
branch 'main':
bpo-45635: refactor print_exception_recursive into smaller functions to 
standardize error handling (GH-30015)
https://github.com/python/cpython/commit/0fe104fce7da709edddb701baa2249e3275db1fd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-09 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28239
pull_request: https://github.com/python/cpython/pull/30015

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-09 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset dc4a212bd305831cb4b187a2e0cc82666fcb15ca by Irit Katriel in 
branch 'main':
bpo-45635: continue refactor of print_exception() to standardize error handling 
(GH-29996)
https://github.com/python/cpython/commit/dc4a212bd305831cb4b187a2e0cc82666fcb15ca


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-08 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28219
pull_request: https://github.com/python/cpython/pull/29996

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-08 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset f893bb2e01307c92ca19597f44874ecaffe7f06f by Irit Katriel in 
branch 'main':
bpo-45635: refactor print_exception() into smaller functions (GH-29981)
https://github.com/python/cpython/commit/f893bb2e01307c92ca19597f44874ecaffe7f06f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-08 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28207
pull_request: https://github.com/python/cpython/pull/29981

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-07 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset d596acbd3b4f6716ed98895eb0b48e9830e0b320 by Irit Katriel in 
branch 'main':
bpo-45635: standardize error handling in traceback.c (GH-29905)
https://github.com/python/cpython/commit/d596acbd3b4f6716ed98895eb0b48e9830e0b320


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-03 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
pull_requests: +28129
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29905

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-11-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-11-01 Thread Irit Katriel


Irit Katriel  added the comment:

It's more intricate than I initially thought - the assertion that no exception 
is set is in PyObject_Str rather than PyFile_WriteObject, and it should remain 
there because it ensures that exceptions are not accidentally cleared by an 
str() call.

In the traceback display code, there are places where the exception is cleared 
because it's being overridden (like when modulename is not found and is replace 
by "") or places where the code makes a best-effort attempt to print 
something anyway. In these situations the error is cleared before calling 
PyFile_WriteObject. It is probably correct, but it's hard to follow the logic 
when making changes to the code, so it should be made more explicit.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-10-27 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Interpreter Core
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-10-27 Thread Irit Katriel


New submission from Irit Katriel :

They do things like 

err = PyFile_WriteString("TypeError: print_exception(): Exception expected 
for value, ", f);
err += PyFile_WriteString(Py_TYPE(value)->tp_name, f);
err += PyFile_WriteString(" found\n", f);

which means that PyFile_XXX functions are called after error. They should 
return (abort printing the exception) instead.


It gets even more interesting with PyFile_WriteObject calls - this function 
asserts that the exception is not set, so the code calls PyErr_Clear() before 
calling PyFile_WriteObject(). It should avoid making the call altogether.

--
assignee: iritkatriel
messages: 405126
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Tidy up error handling in traceback.c / python run.c

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com