Irit Katriel <[email protected]> added the comment:
Still the same in 3.11:
>>> import inspect
>>> def fun(x):
... del x
... return inspect.currentframe()
...
>>> inspect.formatargvalues(*inspect.getargvalues(fun(10)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\User\src\cpython-dev\lib\inspect.py", line 1444, in
formatargvalues
specs.append(convert(args[i]))
File "C:\Users\User\src\cpython-dev\lib\inspect.py", line 1441, in convert
return formatarg(name) + formatvalue(locals[name])
KeyError: 'x'
>>>
----------
nosy: +iritkatriel
title: cgitb fails when frame arguments are deleted (due to inspect bug I
think) -> inspect.getargvalues fails if arg name is not bound to a value
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue17246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com