tomlkit 0.15.1 fails on out-of-order table header
维护者通常 1 天内回复
评估
调研方向
Reproduce with the given document: tomlkit.loads fails with Key "b" already exists while tomllib.loads succeeds. Start from tomlkit's table/key parsing path (the loads entry point and how dotted keys and later [a.b.e] headers merge into an existing [a] table). Done when that document and similar out-of-order headers parse without error and round-trip without changing unrelated style.
由索引模型根据 Issue 内容生成。
描述
tomlkit 0.15.1 and earlier fail to parse out-of-order table header. The following example is valid TOML and loads fine with stdlib tomllib.
import tomllib, tomlkit
doc = """\
[a]
b.c = 1
b.d = 2
[x]
y = 1
[a.b.e]
f = 3
"""
tomllib.loads(doc) # OK
tomlkit.loads(doc) # ParseError: Key "b" already exists. at line 9 col 0
We noticed this problem while parsing the pyproject.toml file of geventhttpclient-2.5.0 https://raw.githubusercontent.com/geventhttpclient/geventhttpclient/refs/tags/2.5.0/pyproject.toml . See https://github.com/python-wheel-build/fromager/issues/1356
- 主要语言
- Python
- 星标
- 859
- 派生
- 186
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-poetry/tomlkit 的其他 Issue
-
item() reorders keys (dict-valued before scalar) even with the default sort_keys=False可能已有人在做 @uttam12331 于 99 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
python-poetry/tomlkit#546 · 2 条评论 ·
维护者通常 1 天内回复
-
`dumps(sort_keys=True)` only sorts the top level of a parsed document (nested tables / inline tables / AoT keep original order)可能已有人在做 @Sreekant13 于 13 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
python-poetry/tomlkit#614 · 2 条评论 ·
维护者通常 1 天内回复
-
toml-test datetime cases use tomlkit's own parse_rfc3339 as the expected value, so they cannot detect datetime parsing bugs可能已有人在做 @ekanshul 于 5 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
python-poetry/tomlkit#603 ·
维护者通常 1 天内回复
-
`Array.add_line()` doesn't serialize as documented (or expected) and can even produce syntactically invalid TOML可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 52/100
python-poetry/tomlkit#580 · 1 条评论 ·
维护者通常 1 天内回复
-
unwrap raises KeyAlreadyPresent for an out-of-order AoT element extension可能已有人在做 @davidpavlovschi 于 76 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
python-poetry/tomlkit#577 ·
维护者通常 1 天内回复
查看 python-poetry/tomlkit 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
spec-kitty/spec-kitty#6112 ·
维护者通常 1 天内回复
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter served可能已有人在做 @Mrun25 今天认领。 未关闭bug llm translation
难度 2/5 1-3 小时 新手友好度 75/100
BerriAI/litellm#46095 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
uberdeveloper/fastbt#29 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
andrew-blake/melcloudhome#368 ·
维护者通常 1 天内回复
-
lane:discover
难度 2/5 1-3 小时 新手友好度 72/100
SPARDiffData/differential-data-collection#33 ·
维护者通常 1 天内回复