This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ppperry
Recipients ppperry
Date 2018-09-23.21:38:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za>
In-reply-to
Content
class FakeContainer:
	def __getitem__(self, key)
		raise KeyError(key)
pdb.run("pass",{},FakeContainer())

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    pdb.run("pass",{},FakeContainer())
  File "C:\Program Files\Python37\lib\pdb.py", line 1590, in run
    Pdb().run(statement, globals, locals)
  File "C:\Program Files\Python37\lib\bdb.py", line 585, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python37\lib\bdb.py", line 88, in trace_dispatch
    return self.dispatch_line(frame)
  File "C:\Program Files\Python37\lib\bdb.py", line 112, in dispatch_line
    self.user_line(frame)
  File "C:\Program Files\Python37\lib\pdb.py", line 261, in user_line
    self.interaction(frame, None)
  File "C:\Program Files\Python37\lib\pdb.py", line 351, in interaction
    self.print_stack_entry(self.stack[self.curindex])
  File "C:\Program Files\Python37\lib\pdb.py", line 1453, in print_stack_entry
    self.format_stack_entry(frame_lineno, prompt_prefix))
  File "C:\Program Files\Python37\lib\bdb.py", line 549, in format_stack_entry
    if '__args__' in frame.f_locals:
  File "<pyshell#3>", line 3, in __getitem__
    raise KeyError
KeyError: 0

Obviously, the debugger shouldn't crash in this case (running code outside of the debugger works as expected, producing a NameError on variable reads and a TypeError whenever a name is assigned).
History
Date User Action Args
2018-09-23 21:38:01ppperrysetrecipients: + ppperry
2018-09-23 21:38:01ppperrysetmessageid: <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za>
2018-09-23 21:38:01ppperrylinkissue34782 messages
2018-09-23 21:38:01ppperrycreate