Skip to content

Inconsistent quoting behavior when serializing strings starting with zero #701

@jefmathiot

Description

@jefmathiot

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions