[issue4643] cgitb.html fails if getattr call raises exception

karl report at bugs.python.org
Sat Jan 2 08:21:57 EST 2021


karl <karl+pythonbugs at la-grange.net> added the comment:

> The getattr call here has a default value, so it should not raise AttributeError. It should also not raise any other exception because a valid implementation of __getattr__ should raise only AttributeError:


but probably the intent of the patch here is to surface a meaningful error with regards to the script, more than an error on the cgitb python lib itself as this is a traceback tool. A bit like an HTML validator which continue to process things to give some kind of meaning.

Diving into previous issues about scanvars
https://bugs.python.org/issue966992

Similar
https://bugs.python.org/issue1047397 The last comment is basically this issue here. 

There is a patch which is lot better for this bug and which addresses the issues here. 
https://github.com/python/cpython/pull/15094

It has not been merged yet. Not sure why or if there is anything missing. 

Probably this bug could be closed as a duplicate of https://bugs.python.org/issue966992


And someone needs to push to push the latest bits for https://github.com/python/cpython/pull/15094


What do you think @iritkatriel ?

I will close my PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue4643>
_______________________________________


More information about the Python-bugs-list mailing list