[issue30926] KeyError with cgitb inspecting exception in generator expression

2020-09-01 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> wont fix
stage:  -> 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



[issue30926] KeyError with cgitb inspecting exception in generator expression

2020-09-01 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2.7 is no longer supported, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue30926] KeyError with cgitb inspecting exception in generator expression

2017-07-13 Thread Jason R. Coombs

New submission from Jason R. Coombs:

Consider this script, which runs successfully on Python 3:

import cgitb
import sys


def fiter():
assert False
yield 1, 1
yield 2, 2
yield 3, 3


try:
x = set(id_ for id_, _ in fiter())
except:
print cgitb.html(sys.exc_info())


Run the same script on Python 2.7.13 and you get this error:

Traceback (most recent call last):
  File "test.py", line 15, in 
print(cgitb.html(sys.exc_info()))
  File ".../cgitb.py", line 130, in html
formatvalue=lambda value: '=' + pydoc.html.repr(value))
  File ".../inspect.py", line 887, in formatargvalues
specs.append(strseq(args[i], convert, join))
  File ".../inspect.py", line 840, in strseq
return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
  File ".../inspect.py", line 840, in 
return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
  File ".../inspect.py", line 842, in strseq
return convert(object)
  File ".../inspect.py", line 884, in convert
return formatarg(name) + formatvalue(locals[name])
KeyError: 'id_'


Wrap the generator expression in [] and it also succeeds.

Given that the issue only exists on Python 2.7, it may not need to be 
addressed, but I wanted to log the issue nonetheless.

--
components: Interpreter Core, Library (Lib)
messages: 298314
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: KeyError with cgitb inspecting exception in generator expression
versions: Python 2.7

___
Python tracker 

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