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
- 平均合併
- 5 小時 47 分鐘
- 30 天內合併 PR
- 3
環境準備
- 沒有 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 於 62 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 68/100
-
難度 4/5 3-5 天 新手友好度 52/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 68/100
metanorma/metanorma-cli#494 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 91/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆