pydevd_sys_monitoring crashing with inexplicable TypeError
A strange crash in the debugger:
for filename in os.listdir(target):
File "<stringsource>", line 69, in cfunc.to_py.__Pyx_CFunc_7f6725__29_pydevd_sys_monitoring_cython_object__lParen__etc_to_py_4code_11from_offset_9to_offset.wrap
File "_pydevd_sys_monitoring\\_pydevd_sys_monitoring_cython.pyx", line 1332, in _pydevd_sys_monitoring_cython._jump_event
TypeError: an integer is required
I am using:
PyDev for Eclipse 12.1.0.202405272215 org.python.pydev.feature.feature.group Fabio Zadrozny
PyDev for Eclipse Developer Resources 12.1.0.202405272215 org.python.pydev.feature.source.feature.group Fabio Zadrozny
in Eclipse:
Version: 2024-03 (4.31.0)
Build id: 20240307-1437
I restarted Eclipse, no change. I pulled an age old trick I picked up in the 1980s no less, of inserting a null statement just before the crash line (in Python a pass statement). And voila, the crash disappeared.
Essentially:
for filename in os.listdir(target):
<my guff>
crashes, and this:
for filename in os.listdir(target):
<my guff>
pass
does not. So my code moving forwards reads:
for filename in os.listdir(target):
<my guff>
pass # Debugger 12.1 bug crashes here without this statement
I reckon there's still a line thus annotated in FORTRAN code I wrote in the '80s and maybe a few other code bases around the world ;-).
Thank you for the report (this may need a bit of investigation on my side...).
I encountered the same issue during debugging, and I was able to resolve it by downgrading the debugpy version to 1.8.0. After doing this, the debugging process worked smoothly without any further errors.
Just want to chime in that I'm also running into this error somewhat suddenly. Working in a codebase I've been working in for a while, vscode did update recently, so I assume updated pydevd with it.
I tried natuan9's fix, but that did not work. Rolled back to the previous python debugger extension in VScode and that fixed it. I'm assuming this is related to the new functionality mentioned in the readme, as I am running python 3.12
I encountered the same issue during debugging, and I was able to resolve it by downgrading the
debugpyversion to 1.8.0. After doing this, the debugging process worked smoothly without any further errors.
Thanks for suggesting this. In vscode, I went from ms-python.debugpy v2024.12.0 to v2024.10.0 and that solved the issue for me.
Same issue here.
I believe the root cause of this issue is code.co_lines() can return 'None' for lines and pydevd wasn't handling that case: https://docs.python.org/3/reference/datamodel.html#codeobject.co_lines
Hey everyone, i am encountered with error "File "_pydevd_sys_monitoring\_pydevd_sys_monitoring_cython.pyx", line 1017, in _pydevd_sys_monitoring_cython._show_return_values TypeError: 'LazyLocalNamespace' object does not support item assignment" and used all above advise, but error does not go away. Maybe are there other ways solving this problem. Thanks in advance!