Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of quoted keys #311

Open
mgrandi opened this issue Apr 23, 2023 · 0 comments
Open

Incorrect parsing of quoted keys #311

mgrandi opened this issue Apr 23, 2023 · 0 comments

Comments

@mgrandi
Copy link

mgrandi commented Apr 23, 2023

pyhocon version 0.3.60

given the config:

group_key {
    
    key_one = "one"

    "key.two" = "two"
}

when you parse it with lightbend config:

        // -Dconfig.file=C:/Users/auror/Temp/csgo_workshop_download_temp/test_hocon.conf
        Config conf = ConfigFactory.load();
        Config c2 = conf.getConfig("group_key");

        System.out.println("c2: " + c2.toString());

you get:

c2: Config(SimpleConfigObject({"key.two":"two","key_one":"one"}))

but with pyhocon:


> python
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyhocon
>>> config = pyhocon.ConfigFactory.parse_file("C:/Users/auror/Temp/csgo_workshop_download_temp/test_hocon.conf")
>>> print(config)
ConfigTree([('group_key', ConfigTree([('key_one', 'one'), ('"key.two"', 'two')]))])
>>>

note how the quoted key is double wraped in quotes, it should be key.two rather than "key.two"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant