I'm having an issue with debugging. First, my setup:
WinXP
Eclipse 3.2.2
PyDev 1.3.3
Python 2.5.1
Any time I try to Debug a script, the debugger starts up, but completely ignores any breakpoints. The script then runs to completion, just as it would in a normal Run configuration. This only happens with Python 2.5.0 and 2.5.1. Python 2.4.4 seems to be fine (but I get an aforementioned issue with urllib not recognizing unicode characters).
I've recreated my projects, rebooted, waved dead chickens, and nothing seems to affect it. Nothing shows up in the PDE error log, or the console output. It's as if breakpoints simply don't exist. I've read through the user forum and the bug database, but nothing quite applies. I'm out of ideas. Does anyone else have some?
-Dan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-05-22
Some clarifications:
This occurs on even the most simple scripts, with or without any imports. It also occurs when doing a debugging a Unit Test.
While this is seemingly related to an earlier post by a fellow having the same issue when importing TurboGears, he was at least able to break into the debugger after removing TurboGears. I am having zero luck getting into the debugger under any circumstances.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-05-22
Here is a sample:
-----------------------------------------------------------
dummy = True
dummy2 = False
for i in range(10):
print i # breakpoint here
-----------------------------------------------------------
And here is the output after setting
pydevd_trace = 2
pydevd_trace_breakpoints = 2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-05-23
Oddly enough, I just discovered PyDev 1.3.2 doesn't exhibit this issue. However, I do get the aforementioned urllib + unicode error, which, while annoying, doesn't affect anything.
-------------------------------------------------------
Traceback (most recent call last):
File "C:\eclipse\plugins\org.python.pydev.debug_1.3.2\pysrc\pydevd_vars.py", line 156, in frameVarsToXML
xml += varToXML(v, str(k))
File "C:\eclipse\plugins\org.python.pydev.debug_1.3.2\pysrc\pydevd_vars.py", line 135, in varToXML
xmlValue = ' value="%s"' % (makeValidXmlValue(urllib.quote(value, '/>_= \t')))
File "c:\python25\lib\urllib.py", line 1205, in quote
res = map(safe_map.__getitem__, s)
KeyError: u'\xa1'
unexpected error, recovered safely u'\xa1'
-------------------------------------------------------
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There were some optimizations in pydev 1.3.3, so, maybe one of those optimization is making you miss the breakpoints. As you said it's only in python 2.5, pydev may be relying on some info that's not there anymore (please report it as a bug).
As for the urllib error, please report it as a bug too.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think I found the problem: python 2.5 breaks the 'frame.f_code.co_name' interface in the module level. Before it added '?' as the co_name, and now it says '<module>'.
So, please try the following:
At org.python.pydev.debug/pysrc/pydevd_frame.py at line 48, where it says:
if curr_func_name == '?':
change it to:
if curr_func_name == '?' or curr_func_name == '<module>':
This should make it work again (if that doesn't solve it, please report again).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, kind of works. I use stackless (http://www.stackless.com), and used it with no problems in previous pydev versions. With the fix above, it stops at breakpoints in the main stack, but if i have any tasklets, I cant break in them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Humm... I have to see how stackless breaks those functions... meanwhile, you can probably comment lines 46-64 in pydevd_frame.py to make it work (it'll be a bit slower, but should work) -- also, please report that as a bug regarding stackless and the debugger.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having an issue with debugging. First, my setup:
WinXP
Eclipse 3.2.2
PyDev 1.3.3
Python 2.5.1
Any time I try to Debug a script, the debugger starts up, but completely ignores any breakpoints. The script then runs to completion, just as it would in a normal Run configuration. This only happens with Python 2.5.0 and 2.5.1. Python 2.4.4 seems to be fine (but I get an aforementioned issue with urllib not recognizing unicode characters).
I've recreated my projects, rebooted, waved dead chickens, and nothing seems to affect it. Nothing shows up in the PDE error log, or the console output. It's as if breakpoints simply don't exist. I've read through the user forum and the bug database, but nothing quite applies. I'm out of ideas. Does anyone else have some?
-Dan
Some clarifications:
This occurs on even the most simple scripts, with or without any imports. It also occurs when doing a debugging a Unit Test.
While this is seemingly related to an earlier post by a fellow having the same issue when importing TurboGears, he was at least able to break into the debugger after removing TurboGears. I am having zero luck getting into the debugger under any circumstances.
Here is a sample:
-----------------------------------------------------------
dummy = True
dummy2 = False
for i in range(10):
print i # breakpoint here
-----------------------------------------------------------
And here is the output after setting
pydevd_trace = 2
pydevd_trace_breakpoints = 2
inside pydevd_common.py
-----------------------------------------------------------
pydev debugger
Executing file D:\doxyconvert\esrd_doxyconvert\src\blah.py
arguments:['D:\\doxyconvert\\esrd_doxyconvert\\src\\blah.py']
Connecting to localhost:14672
Connected.
received command 501 1 1.0
sending cmd 501 1 1.0
Added breakpoint:d:\doxyconvert\esrd_doxyconvert\src\doxy_convert.py - line:5 - func_name:
sending cmd 103 2 <xml><thread name="pydevd.reader" id="-1"/></xml>
received command 111 3 D:\doxyconvert\esrd_doxyconvert\src\doxy_convert.py 5 None
Added breakpoint:d:\doxyconvert\esrd_doxyconvert\src\doxy_convert.py - line:209 - func_name:
received command 111 5 D:\doxyconvert\esrd_doxyconvert\src\doxy_convert.py 209 None
sending cmd 103 4 <xml><thread name="pydevd.writer" id="-1"/></xml>
received command 111 7 D:\doxyconvert\esrd_doxyconvert\src\blah.py 5 None
Added breakpoint:d:\doxyconvert\esrd_doxyconvert\src\blah.py - line:5 - func_name:
received command 101 9
0
1
2
3
4
5
6
7
8
9
-----------------------------------------------------------
Sorry about that. You can ignore the output from the first two breakpoints--they were left over from another source file.
------------------------------------------------------------------------
pydev debugger
Executing file D:\doxyconvert\esrd_doxyconvert\src\blah.py
arguments:['D:\\doxyconvert\\esrd_doxyconvert\\src\\blah.py']
Connecting to localhost:7173
Connected.
received command 501 1 1.0
sending cmd 501 1 1.0
received command 111 3 D:\doxyconvert\esrd_doxyconvert\src\blah.py 5 None
sending cmd 103 2 <xml><thread name="pydevd.reader" id="-1"/></xml>
Added breakpoint:d:\doxyconvert\esrd_doxyconvert\src\blah.py - line:5 - func_name:
received command 101 5
sending cmd 103 4 <xml><thread name="pydevd.writer" id="-1"/></xml>
0
1
2
3
4
5
6
7
8
9
------------------------------------------------------------------------
Oddly enough, I just discovered PyDev 1.3.2 doesn't exhibit this issue. However, I do get the aforementioned urllib + unicode error, which, while annoying, doesn't affect anything.
-------------------------------------------------------
Traceback (most recent call last):
File "C:\eclipse\plugins\org.python.pydev.debug_1.3.2\pysrc\pydevd_vars.py", line 156, in frameVarsToXML
xml += varToXML(v, str(k))
File "C:\eclipse\plugins\org.python.pydev.debug_1.3.2\pysrc\pydevd_vars.py", line 135, in varToXML
xmlValue = ' value="%s"' % (makeValidXmlValue(urllib.quote(value, '/>_= \t')))
File "c:\python25\lib\urllib.py", line 1205, in quote
res = map(safe_map.__getitem__, s)
KeyError: u'\xa1'
unexpected error, recovered safely u'\xa1'
-------------------------------------------------------
There were some optimizations in pydev 1.3.3, so, maybe one of those optimization is making you miss the breakpoints. As you said it's only in python 2.5, pydev may be relying on some info that's not there anymore (please report it as a bug).
As for the urllib error, please report it as a bug too.
Cheers,
Fabio
Yep, I also have this problem. Anyone know any fixes/workaround APART from downgrading?
I think I found the problem: python 2.5 breaks the 'frame.f_code.co_name' interface in the module level. Before it added '?' as the co_name, and now it says '<module>'.
So, please try the following:
At org.python.pydev.debug/pysrc/pydevd_frame.py at line 48, where it says:
if curr_func_name == '?':
change it to:
if curr_func_name == '?' or curr_func_name == '<module>':
This should make it work again (if that doesn't solve it, please report again).
Cheers,
Fabio
Oops, it's in line 51...
Cheers,
Fabio
Yep, that fix works, thanks.
Well, kind of works. I use stackless (http://www.stackless.com), and used it with no problems in previous pydev versions. With the fix above, it stops at breakpoints in the main stack, but if i have any tasklets, I cant break in them.
Humm... I have to see how stackless breaks those functions... meanwhile, you can probably comment lines 46-64 in pydevd_frame.py to make it work (it'll be a bit slower, but should work) -- also, please report that as a bug regarding stackless and the debugger.
Cheers,
Fabio