Skip to content

from_ini() returns a str instead of a dict #284

@d-chris

Description

@d-chris

Python version
Python 3.11.0

Package version
python-benedict==0.30.0

Current behavior (bug description)

from benedict import benedict

original = benedict({
    'section1': {'key1': 'value1'},
    'sectionA': {'keyA': 'valueA', 'keyB': 'valueB', 'keyC': {'subkeyC': 'subvalueC'}},
})

readback = benedict.from_ini(original.to_ini())


print('original vs readback')

path = 'sectionA.keyC'

print(original.get(path), type(original.get(path)))
print('-- vs --')
print(readback.get(path), type(readback.get(path)))

output

original vs readback
{'subkeyC': 'subvalueC'} <class 'benedict.dicts.benedict'>
-- vs --
{'subkeyC': 'subvalueC'} <class 'str'>

Expected behavior
value type of the keyC is a dict not a string

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions