Issue with debugpy affecting objects refcount
@rchiodo ci sta già lavorando.
Dal 4/3/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Environment data
- debugpy version: 1.8.1
- OS and version: Windows 11
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.11
- Using VS Code or Visual Studio: VS Code 1.93.1
Actual behavior
Consider snippet below - when executing with a debugger attached it fails with an error below.
x.resize(4)
ValueError: cannot resize an array that references or is referenced
by another array in this way.
Use the np.resize function or refcheck=False
import numpy as np
import sys
# import debugpy
# debugpy.listen(5678)
# debugpy.wait_for_client()
x = np.ones(3)
print(sys.getrefcount(x))
# ValueError: cannot resize an array that references or is referenced
# by another array in this way.
# Use the np.resize function or refcheck=False
x.resize(4)
print(x)
Investigating I've noticed 3 different behaviours:
-
Running it just using
python test.py- prints2as the refcount and produce no errors. -
Running it using VS Code's "Debug Python File"
or by uncommentingdebugpypart and attaching debugger later - it prints2but fails with an error. -
Running it with VS Code/debugpy debugger but setting breakpoint at
x = np.ones(3)and then stepping through all lines - then it prints3and also fails with an error.
Expected behavior
Code execution not to be affected by the debugging process.
Related - https://github.com/IfcOpenShell/IfcOpenShell/issues/6256
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 205
- Merge medio
- 1g 9h
- PR unite (30g)
- 3
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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
-
pydevd_comm.py start_client() does not set TCP_NODELAY on the connections it opensForse già presa @nightcityblade l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Document "rules"-optionForse già presa @nightcityblade l’ha presa 38 giorni fa. Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
wx.EventLoop() deprecation warningForse già presa @nightcityblade l’ha presa 36 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
debugpy.configure(python=) is not properly documentedForse già presa @nightcityblade l’ha presa 47 giorni fa. Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopbackForse già presa @nightcityblade l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di microsoft/debugpy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
FuRongJun-1999/dsh-memory#56 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pgadmin-org/pgadmin4#10503 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
521xueweihan/HelloGitHub#3857 ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
rai-opensource/spatialmath-python#235 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-ac
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Ikalus1988/MisakaNet#2845 ·
I maintainer di solito rispondono entro 1 giorno