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

Support for pathlib.Path. #144

Closed
svisser opened this issue Nov 21, 2022 · 1 comment
Closed

Support for pathlib.Path. #144

svisser opened this issue Nov 21, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@svisser
Copy link

svisser commented Nov 21, 2022

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
@svisser svisser added the enhancement New feature or request label Nov 21, 2022
@fabiocaccamo fabiocaccamo changed the title Support for pathlib.Path Support for pathlib.Path. Dec 1, 2022
fabiocaccamo added a commit that referenced this issue Jan 2, 2023
@fabiocaccamo
Copy link
Owner

@svisser fixed in 0.28.1 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants