Support for `pathlib.Path`.
svisser opened this issue · comments
Simeon Visser commented
This is an issue to explore adding support for Python's pathlib. At the moment the following works:
>>> d = benedict("test.json", format="json")
>>> d
{'test': 123}
but the following raises an error:
>>> import pathlib
>>> d = benedict(pathlib.Path("test.json"), format="json")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
....
File ".../lib/python3.11/site-packages/benedict/dicts/parse/parse_dict.py", line 15, in __init__
super(ParseDict, self).__init__(*args, **kwargs)
File ".../lib/python3.11/site-packages/benedict/dicts/base/base_dict.py", line 30, in __init__
super(BaseDict, self).__init__(*args, **kwargs)
TypeError: 'PosixPath' object is not iterable
Fabio Caccamo commented
@svisser fixed in 0.28.1
version.