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 xdegaye
Recipients xdegaye
Date 2012-05-13.15:25:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336922756.85.0.281707317817.issue14795@psf.upfronthosting.co.za>
In-reply-to
Content
In the following test, breakpoint 2 is set incorrectly at line 1 and
pdb does not know how to set a breakpoint on method C.c_foo. However
setting those two breakpoints on both methods is ok after the class
definition has been executed.


===   main.py   =================================
def foo():
    pass

class C:
    def c_foo(self):
        pass
    def foo(self):
        pass

foo()
=================================================
$ python3.1 -m pdb main.py
> /path_to/main.py(1)<module>()
-> def foo():
(Pdb) import sys; print(sys.version)
3.1.2 (r312:79147, Apr  4 2010, 17:46:48) 
[GCC 4.3.2]
(Pdb) break foo
Breakpoint 1 at /path_to/main.py:1
(Pdb) break C.foo
Breakpoint 2 at /path_to/main.py:1
(Pdb) break C.c_foo
*** The specified object 'C.c_foo' is not a function
or was not found along sys.path.
(Pdb) break 10
Breakpoint 3 at /path_to/main.py:10
(Pdb) continue
> /path_to/main.py(10)<module>()
-> foo()
(Pdb) break C.foo
Breakpoint 4 at /path_to/main.py:7
(Pdb) break C.c_foo
Breakpoint 5 at /path_to/main.py:5
(Pdb) quit
=================================================

The attached patch fixes the problem. The patch includes a test case.
History
Date User Action Args
2012-05-13 15:25:57xdegayesetrecipients: + xdegaye
2012-05-13 15:25:56xdegayesetmessageid: <1336922756.85.0.281707317817.issue14795@psf.upfronthosting.co.za>
2012-05-13 15:25:56xdegayelinkissue14795 messages
2012-05-13 15:25:55xdegayecreate