Skip to content

Unexpected INI parsing of keys with colon #2426

Open
@Zash

Description

@Zash

Describe the bug
I tried the new INI support on some random files I had around my system and found that a key like this:key = value gets parsed in a way I did not expect. Notably some Mercurial config files containing lines like default:pushurl = ssh://[email protected]/repo/

Version of yq: 4.46.1
Operating system: linux
Installed via: binary release

Input INI
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.ini:

[this:section]
this:line = should really work
yq --input-format ini --output-format json data1.ini

Actual behavior

{
  "this:section": {
    "this": "line = should really work"
  }
}

Expected behavior

{
  "this:section": {
    "this:line" : "should really work"
  }
}

Additional context
I'm not actually sure if INI has a specification and if so, what it says about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions