Regression: impossible to dump multiline strings with leading newline
维护者通常 3 天内回复
评估
调研方向
Start with the reproduction: tomlkit.string(...) with escape=False passed to tomlkit.dumps, comparing the output with and without the leading newline. The behaviour change came from pull request #551, and open pull request #656 already proposes moving it under the escape flag, so read that diff first. Done means the aligned-strings example dumps without the extra newline, and the maintainers have agreed on the fix since #656 is still open.
由索引模型根据 Issue 内容生成。
描述
Pull request #551 changed the behaviour of raw, non-escaped string values. Running
import tomlkit
s = tomlkit.string(
"\n aligned\n strings\n",
multiline=True,
literal=True,
escape=False,
)
print(tomlkit.dumps(s))
used to output
'''
aligned
strings
'''
as expected, but now outputs
'''
aligned
strings
'''
(note the extra newline). In fact, it is now impossible to produce the desired output.
Proposed fix: hide the behaviour change of #551 under the escape flag.
- 主要语言
- Python
- 星标
- 859
- 派生
- 186
- 平均合并
- 4 天 14 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-poetry/tomlkit 的其他 Issue
-
In-place array repetition changes values without updating serialized TOML可能已有人在做 @harbinresearcher 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
python-poetry/tomlkit#646 · 1 条评论 ·
维护者通常 3 天内回复
-
tomlkit 0.15.1 fails on out-of-order table header可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
python-poetry/tomlkit#632 ·
维护者通常 3 天内回复
-
`dumps(sort_keys=True)` only sorts the top level of a parsed document (nested tables / inline tables / AoT keep original order)可能已有人在做 @Sreekant13 于 15 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
python-poetry/tomlkit#614 · 2 条评论 ·
维护者通常 3 天内回复
-
toml-test datetime cases use tomlkit's own parse_rfc3339 as the expected value, so they cannot detect datetime parsing bugs可能已有人在做 @ekanshul 于 6 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
python-poetry/tomlkit#603 ·
维护者通常 3 天内回复
-
unwrap raises KeyAlreadyPresent for an out-of-order AoT element extension可能已有人在做 @davidpavlovschi 于 77 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
python-poetry/tomlkit#577 ·
维护者通常 3 天内回复
查看 python-poetry/tomlkit 的全部 Issue
相似的 Issue
-
vis.image() reports "Unsupported number of image channels: 224" for an HxWxC image可能已有人在做 @piyush182004 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
fossasia/visdom#1997 · 3 条评论 ·
维护者通常 6 天内回复
-
Byse new domain未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Gujal00/ResolveURL#1525 ·
维护者通常 1 天内回复
-
Serialisation fails with pydantic 2.14: wrap serialisers pass SerializationInfo as index_key可能已有人在做 @hugohills-regnosys 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
finos/rune-python-runtime#45 ·
-
[Bug]: LangGraph Store sync put bypasses namespace validation可能已有人在做 @ktz03 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
volcengine/OpenViking#6050 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
hummingbot/condor#283 ·
维护者通常 1 天内回复