Open amadanmath opened 2 weeks ago
This is probably caused by the message reader background thread waiting on stdin.read()
when KeyboardInterrupt
happens on main thread. If so, I think it could be fixed by catching the exception there and pre-emptively os.close(stdin_fd)
before exiting.
I am not sure I understand it correctly, not knowing the structure of debugpy, but note that the same happens without KeyboardInterrupt
, purely by executing the last line of the program from NeoVim's debugger (nvim-dap). So it seems it might be on any exit of pydebug, not just keyboard interrupted one. I don't know how to speak the pydebug protocol, so I can't test the hypothesis without the aid of an editor.
Environment data
Problem description
I was trying to set up
nvim-dap-python
on NeoVim. It works until I execute the last instruction; when the debugger is expected to shut down, a Problem Report for Python window pops up. Investigating further, I could reproduce the error purely in command-line, without NeoVim:Starting the adapter with
and letting it output the first three events (two telemetry outputs, one
debugpySockets
); then stopping it with Ctrl-C.Actual behavior
After outputting two more events, a Fatal Python Error is raised.
Additionally, Problem Report for Python window is shown, with the following information:
Expected behavior
No Fatal Python Error, and no Problem Report for Python window
Steps to reproduce:
python -m debugpy.adapter
I also tried with different versions of
debugpy
, all the way todebugpy==1.0.0
, and I still get the same problem.