Allow clients to debug code from command line, like pdb or epdb
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia da debugpy/main.py e server/cli.py, quindi segui il percorso segnalato attraverso server/api.py e i file pydevd forniti come vendor. Riproduci il problema di OutputEvent/command e determina se il debugging da riga di comando e nella shell interattiva è supportato. Il lavoro è completato quando un workflow da riga di comando concordato funziona senza questo problema e il suo utilizzo è documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi there,
in my company many don't use VSCode. For this reason our main guidelines to debug are to use pdb or epdb. (https://pypi.org/project/epdb/)
However, in an effort to have just one library that works for all use cases, I'd like to have debugpy to work from command line too.
I have tried this:
python -m debugpy --connect 5678 <path of the file with debugpy.listen()>
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 252, in _on_run
self.process_net_command_json(self.py_db, json_contents)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py", line 171, in process_net_command_json
method_name = 'on_%s_request' % (request.command.lower(),)
AttributeError: 'OutputEvent' object has no attribute 'command'
^CTraceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/__main__.py", line 39, in <module>
cli.main()
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/cli.py", line 430, in main
run()
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/cli.py", line 268, in run_file
start_debugging(target)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/cli.py", line 258, in start_debugging
debugpy.connect(options.address, access_token=options.adapter_access_token)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/public_api.py", line 31, in wrapper
return wrapped(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/api.py", line 141, in debug
return func(address, settrace_kwargs, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/api.py", line 297, in connect
_settrace(host=host, port=port, client_access_token=access_token, **settrace_kwargs)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/server/api.py", line 45, in _settrace
return pydevd.settrace(*args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 2821, in settrace
_locked_settrace(
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 2929, in _locked_settrace
py_db.wait_for_ready_to_run()
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/pydevd.py", line 838, in wait_for_ready_to_run
self._py_db_command_thread_event.wait(0.1)
File "/usr/local/lib/python3.8/threading.py", line 558, in wait
signaled = self._cond.wait(timeout)
File "/usr/local/lib/python3.8/threading.py", line 306, in wait
gotit = waiter.acquire(True, timeout)
doesn't stop in debug.
I've also tried to use debugpy in python shell:
>>> import debugpy
>>> debugpy.connect(5678)
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 252, in _on_run
self.process_net_command_json(self.py_db, json_contents)
File "/root/.cache/pypoetry/virtualenvs/viralize-adserver-9TtSrW0h-py3.8/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py", line 171, in process_net_command_json
method_name = 'on_%s_request' % (request.command.lower(),)
AttributeError: 'OutputEvent' object has no attribute 'command'
What is supposed to be this "command"?
Also, am I doing something that is intended to be used like this, or what? I think no, because there is no such reference on the web.
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 202
- Merge medio
- 5g 1h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/debugpy
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Document "rules"-option Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di microsoft/debugpy
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·