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 terry.reedy
Recipients georg.brandl, terry.reedy, xdegaye
Date 2014-07-19.22:04:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405807473.93.0.704954731019.issue21997@psf.upfronthosting.co.za>
In-reply-to
Content
With Python 3.4.1, Win 7, there is a detour stepping through displayhook before arriving at the same place with the same result upon quitting. If one does not quit, stepping ends at

> c:\programs\python34\lib\threading.py(235)__enter__()
-> return self._lock.__enter__()
(Pdb) s
--Return--
s <no response>
---------------

With respect to b, the exception, this seems to be a duplicate, and I am inclined to close this issue as such.

With respect to a, not stopping, this is not a bug, at least not one involving Idle. Idle executes code within an exec call within a call of the runcode method of the Executive class. In a similar circumstance, the console interpreter does not stop either. So I have removed Idle from the title and components.

A direct exec is semi-problemmatical. 

>>> import pdb
>>> def do(): pdb.set_trace()
...
>>> exec('do()', locals())
--Return--
> <stdin>(1)do()->None
(Pdb) s
--Return--
> <string>(1)<module>()->None
(Pdb) s
--Return--
> <stdin>(1)<module>()->None
(Pdb) s

# This returns to a '>>>' prompt,

>>> def run(): exec('do()', locals())

# but hitting <return> after this line returns us to the debugger.

--Call--
> c:\programs\python34\lib\encodings\cp437.py(14)decode()
-> def decode(self,input,errors='strict'):
(Pdb)
> c:\programs\python34\lib\encodings\cp437.py(15)decode()
-> return codecs.charmap_decode(input,errors,decoding_table)
(Pdb) q
  File "<stdin>", line 0

    ^
SyntaxError: decoding with 'cp437' codec failed (BdbQuit: )

# Now we are really out.

>>> run()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'run' is not defined

# the def statement did not execute

>>> def run(): exec('do()', globals())
...
>>> run()

# and now the behavior is as reported for Idle

--Return--
> <stdin>(1)do()->None
s

# about 20 steps later, still going.

s
> c:\programs\python34\lib\encodings\cp437.py(19)encode()
-> return codecs.charmap_encode(input,self.errors,encoding_map)[0]
---------------------------------------------

I know very little about the pdb spec and do not know whether the above is a(n unreported) python or pdb bug or not. If any of you think it is, say so. Otherwise this should be closed.
History
Date User Action Args
2014-07-19 22:04:33terry.reedysetrecipients: + terry.reedy, georg.brandl, xdegaye
2014-07-19 22:04:33terry.reedysetmessageid: <1405807473.93.0.704954731019.issue21997@psf.upfronthosting.co.za>
2014-07-19 22:04:33terry.reedylinkissue21997 messages
2014-07-19 22:04:33terry.reedycreate