Inconsistent quoting behavior when serializing strings starting with zero
还没有人认领这个 Issue。
评估
调研方向
首先复现 Psych 中的两个 UUID 序列化用例,并结合 YAML 1.2 的浮点数匹配规则阅读所引用的提交 b737f0811a9687cf86f44f0a35f61cbde9eac673。确认不同的引号方式是否遵循预期的 schema,然后为约定的行为定义一个回归测试。
由索引模型根据 Issue 内容生成。
描述
Hello there,
we detected a weird behavior when serializing UUIDs. Some of them, such as 0054971b-b746-4776-ae7a-d942cd511393, are quoted during dump, whereas others, such as 0645cada-c729-48cb-a4e3-9d8cbc7cb510 aren't.
The observed behavior seems related to this commit created to fix this issue with floats handling.
The YAML 1.2 schema uses this regexp /[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?/ to match floats, but on Psych side this regexp is used: /\A0[0-7]*[89]/, which leads in my understanding to an inconsistent behavior.
I'd be glad to craft a PR but I' not sure whether Psych behavior is expected or not.
Thank you :)
- 主要语言
- Ruby
- 星标
- 596
- 派生
- 224
- 平均合并
- 8 小时 38 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/psych 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Documentation
难度 1/5 1 小时以内 新手友好度 72/100
-
Psych.dump raises Encoding::CompatibilityError for UTF-16/UTF-32 strings可能已有人在做 @Halvanhelv 于 57 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 52/100
相似的 Issue
-
internal product:ai-gateway size: S
难度 2/5 1-3 小时 新手友好度 67/100
Kong/developer.konghq.com#7931 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 78/100
partiql/partiql-lang#105 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
rails/rails-dom-testing#136 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
nesquena/steward-os#79 ·
维护者通常 1 天内回复
-
area/tech debt
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复