Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43396
| From | Robert Kern <robert.kern@gmail.com> |
|---|---|
| Subject | Re: Python pdb bug, followed by bug in bugs.python.org |
| Date | 2013-04-12 00:12 +0530 |
| References | <a34e8251-85df-4486-b5a1-72eb2bb9f353@googlegroups.com> <kk1tfh$1st$1@reader1.panix.com> <b06d47b6-9ecf-44a3-bea2-20994dd0f1f4@googlegroups.com> <CALwzidnmvOCgX+0Vgk+iEOGwYX2QiJkR=-Wo_wDMbcFmFmWevA@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.490.1365705781.3114.python-list@python.org> (permalink) |
On 2013-04-11 23:11, Ian Kelly wrote:
> On Thu, Apr 11, 2013 at 8:56 AM, <donaldcallen@gmail.com> wrote:
>> #! /usr/bin/env python3
>> import pdb
>> def foo(message):
>> print(message)
>> pdb.set_trace()
>> foo('first call')
>> foo('second call')
>>
>> Stick this in an file with execute permission and run it. At the first breakpoint, the backtrace will be correct. Continue. At the second breakpoint, a backtrace will show the foo('first call') on the stack when, in fact, the call came from foo('second call'), as verified by the printed message.
>
>
> This is what I get using Python 3.3.1 in Windows:
>
> C:\Users\ikelly\Desktop>c:\python33\python python_bug.py
> first call
> --Return--
>> c:\users\ikelly\desktop\python_bug.py(7)foo()->None
> -> pdb.set_trace()
> (Pdb) c
> second call
> --Return--
>> c:\users\ikelly\desktop\python_bug.py(7)foo()->None
> -> pdb.set_trace()
> (Pdb) c
Use `where` to see the problem:
[~/scratch]$ python3.3 pdbbug.py
first call
--Return--
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) where
/Users/rkern/scratch/pdbbug.py(5)<module>()
-> foo('first call')
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) c
second call
--Return--
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) where
/Users/rkern/scratch/pdbbug.py(5)<module>()
-> foo('first call')
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb)
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python pdb bug, followed by bug in bugs.python.org donaldcallen@gmail.com - 2013-04-09 08:25 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Arnaud Delobelle <arnodel@gmail.com> - 2013-04-09 21:03 +0100
Re: Python pdb bug, followed by bug in bugs.python.org John Gordon <gordon@panix.com> - 2013-04-09 20:25 +0000
Re: Python pdb bug, followed by bug in bugs.python.org donaldcallen@gmail.com - 2013-04-11 07:56 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-11 11:41 -0600
Re: Python pdb bug, followed by bug in bugs.python.org Robert Kern <robert.kern@gmail.com> - 2013-04-12 00:12 +0530
Re: Python pdb bug, followed by bug in bugs.python.org Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-11 12:55 -0600
Re: Python pdb bug, followed by bug in bugs.python.org Ned Deily <nad@acm.org> - 2013-04-09 15:17 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-04-11 10:50 +1200
Re: Python pdb bug, followed by bug in bugs.python.org Ned Deily <nad@acm.org> - 2013-04-10 23:39 -0700
Re: Python pdb bug, followed by bug in bugs.python.org donaldcallen@gmail.com - 2013-04-11 08:12 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Piotr Dobrogost <p@google-groups-2013.dobrogost.net> - 2013-04-13 10:28 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Ned Deily <nad@acm.org> - 2013-04-13 11:11 -0700
Re: Python pdb bug, followed by bug in bugs.python.org Piotr Dobrogost <p@google-groups-2013.dobrogost.net> - 2013-04-13 10:28 -0700
Re: Python pdb bug, followed by bug in bugs.python.org donaldcallen@gmail.com - 2013-04-11 08:12 -0700
csiph-web