[BUG]: `json.dumps` failed on object with new `_pybind11_conduit_v1` method
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
调研方向
首先,在一个具有 pybind11_conduit_v1 的 pybind11 绑定对象上使用 Python's json.dumps(..., default=vars) 重现该故障,然后比较 pybind11 2.13.5 和 2.13.6 之间的行为。当预期的序列化行为以及 2.13.6 的更改是否属于回归得到明确确定时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
2.13.6
Problem description
A new self._pybind11_conduit_v1_() method that is added to all classes by default breaks the serialization of this object through json.dumps([object with _pybind11_conduit_v1], default=vars). I would like to clarify whether this is by mistake or intentional, considering also that this is a patch release. Thanks!
The error:
File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/triton/compiler/compiler.py", line 315, in compile
metadata_group[metadata_filename] = fn_cache_manager.put(json.dumps(metadata, default=vars), metadata_filename,
File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/__init__.py", line 234, in dumps
return cls(
File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
TypeError: vars() argument must have __dict__ attribute
Reproducible example code
Since this should be a problem with any object, and I have no experience with `pybind`, I will leave it without a reproducer for now, but if it is not so easy to reproduce, I may try to make one.
Is this a regression? Put the last known working version here if it is.
2.13.5
- 主要语言
- C++
- 星标
- 18k
- 派生
- 2.3k
- 平均合并
- 5 天 7 小时
- 30 天内合并 PR
- 53
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pybind/pybind11 的其他 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 4 天内回复
-
triage
难度 1/5 1 小时以内 新手友好度 62/100
pybind/pybind11#5604 · 1 条评论 ·
维护者通常 4 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 4 天内回复
-
docs
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 4 天内回复
-
array_t::at() returns a misaligned reference when the stride is not a multiple of alignof(T)可能已有人在做 @henryiii 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 4 天内回复
相似的 Issue
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
type:bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
tenstorrent/tt-umd#4084 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
ToffelsKater/X4_VR#34 ·
-
difficulty:easy prio:low refactor
难度 2/5 1-3 小时 新手友好度 72/100
NatronGitHub/openfx-supportext#220 ·
维护者通常 1 天内回复