Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Nested groups with duplicate keys trivially do not work #3

@GiovanH

Description

@GiovanH

Input file demo.vdf:

"controller_mappings"
{
	"group"
	{
		"id"		"0"
	}
	"group"
	{
		"id"		"1"
	}
}

Test script:

import PyVDF
with open("demo.vdf") as fp:
    v = PyVDF.PyVDF(data=fp.read())
    print(type(v))
    print(type(v['controller_mappings']))
    print(v.toString())

Expected output:
(demo.vdf)

Actual output:

<class 'PyVDF.PyVDF'>
<class 'dict'>
"controller_mappings"
{
        "group"
        {
                "id"            "1"
        }
}

Not only is this incorrect, but no error is thrown: the resulting data structure is silently malformed and passed along.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions