Issue with debugpy affecting objects refcount
@rchiodo 已经在做这个了。
开始于 2025年3月4日。
评估
这个 Issue 还没有评估数据。
描述
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
- 主要语言
- Python
- 星标
- 2.5k
- 派生
- 205
- 平均合并
- 1 天 43 分钟
- 30 天内合并 PR
- 6
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/debugpy 的其他 Issue
-
pydevd_comm.py start_client() does not set TCP_NODELAY on the connections it opens可能已有人在做 @nightcityblade 于 55 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
Document "rules"-option可能已有人在做 @nightcityblade 于 44 天前认领。 未关闭documentation
难度 2/5 1-3 小时 新手友好度 68/100
-
wx.EventLoop() deprecation warning可能已有人在做 @nightcityblade 于 42 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
-
debugpy.configure(python=) is not properly documented可能已有人在做 @nightcityblade 于 53 天前认领。 未关闭documentation
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 5/5 一周以上 新手友好度 15/100
查看 microsoft/debugpy 的全部 Issue
相似的 Issue
-
area: desktop area: website priority: P2 type: feature
难度 2/5 1-3 小时 新手友好度 62/100
appandflow/stim#3411 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1 小时以内 新手友好度 88/100
baptistehamon/lsapy#185 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
PolicyEngine/policyengine-us#10073 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
syedhamidali/radarx#277 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
Arekkazu/sgpmp-backend#549 ·
维护者通常 1 天内回复