[issue17246] inspect.getargvalues fails if arg name is not bound to a value

2022-03-29 Thread Maciej Górski

Maciej Górski  added the comment:

In my opinion formatargvalues function is quite useless in current day as 
ArgInfo provides all the information. I'm however willing to fix this. IMO we 
should just omit the args/varargs/kwargs that have been deleted, since the 
values do not exist in the current frame anymore.

I can implement the idea propossed in 2013, but I feel this seems less 
intuative(?) and might be worse for backwards compatibility (if anyone ever 
actually expects some values from formatargvalues, but I haven't been able to 
find an example of that).

Thank you in advance for any input.

--
nosy: +macgors

___
Python tracker 

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



[issue17246] inspect.getargvalues fails if arg name is not bound to a value

2022-03-24 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch

___
Python tracker 

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



[issue17246] inspect.getargvalues fails if arg name is not bound to a value

2021-06-18 Thread Irit Katriel


Irit Katriel  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 "", line 1, in 
  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 

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