[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-18 Thread Henry Chen
Henry Chen added the comment: An attempt to clarify the issue in my own mind: def foo(): # import pdb; pdb.set_trace() exec('pass', {}, FakeContainer()) This function runs successfully. But if you uncomment the pdb line and then step thru in the pdb console, there is an Exception.

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks to me like an error in the user code. What is the use case of passing an object that does not implement the mapping interface as locals to pdb.run()? -- ___ Python tracker

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-16 Thread ppperry
ppperry added the comment: You have to step into the eval for the error to be raised. -- ___ Python tracker ___ ___

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-16 Thread Henry Chen
Henry Chen added the comment: Hmm, the example works for me (Python 3.6.5): >>> import pdb >>> class FakeContainer: ... def __getitem__(self, key): ... raise KeyError(key) ... >>> pdb.run("eval('1+1',{},FakeContainer())") > (1)() (Pdb) c >>> As for exec/eval accepting an

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-16 Thread ppperry
ppperry added the comment: The thing is, though, that the same error occurs if a larger code being debugged calls `exec` or `eval` with such a mapping (`pdb.run("eval('1+1',{},FakeContainer())" also crashes with the same error), and the test suite contains code that evals other code in an

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-16 Thread Henry Chen
Henry Chen added the comment: I agree that this behavior is normal, unless there is a use case for passing a partially implemented mapping object to pdb.run. However I cannot think of such a use case. -- ___ Python tracker

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no a crash. There is just an exception raised when you pass an inappropriate object as locals. This is an expected behavior, and I do not think that anything need to be changed. -- nosy: +serhiy.storchaka

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-15 Thread Henry Chen
Change by Henry Chen : -- nosy: +scotchka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-15 Thread BTaskaya
Change by BTaskaya : -- keywords: +patch, patch pull_requests: +11239, 11240 stage: -> patch review ___ Python tracker ___ ___

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2019-01-15 Thread BTaskaya
Change by BTaskaya : -- keywords: +patch pull_requests: +11239 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2018-09-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2018-09-23 Thread ppperry
Change by ppperry : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34782] Pdb crashes when code is executed in a mapping that does not define `__contains__`

2018-09-23 Thread ppperry
New submission from ppperry : class FakeContainer: def __getitem__(self, key) raise KeyError(key) pdb.run("pass",{},FakeContainer()) Traceback (most recent call last): File "", line 1, in pdb.run("pass",{},FakeContainer()) File "C:\Program