We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Python version Python 3.8.3
Python 3.8.3
Package version python-benedict==0.21.0
python-benedict==0.21.0
Current behavior (bug description) bededict.to_json for benedict from generator returns '{}' instead of json dumped dict
bededict.to_json
benedict
'{}'
Expected behavior bededict.to_json should return actual json dumped dict
Steps to reproduce
from benedict import benedict def gen_dict(): for k, v in enumerate('abcd'): yield k, v if __name__ == '__main__': b = benedict(gen_dict()) assert b == {0: 'a', 1: 'b', 2: 'c', 3: 'd'} assert b.to_json() == '{"0": "a", "1": "b", "2": "c", "3": "d"}'
But if recast benedict to dict and back to benedict it works fine
dict
if __name__ == '__main__': b = benedict(gen_dict()) b = benedict(dict(b)) assert b == {0: 'a', 1: 'b', 2: 'c', 3: 'd'} assert b.to_json() == '{"0": "a", "1": "b", "2": "c", "3": "d"}'
The text was updated successfully, but these errors were encountered:
Fixed to_json returns empty dict from generator. #38
497d378
You can upgrade to 0.21.1 version.
0.21.1
Sorry, something went wrong.
fabiocaccamo
No branches or pull requests
Python version
Python 3.8.3
Package version
python-benedict==0.21.0
Current behavior (bug description)
bededict.to_json
forbenedict
from generator returns'{}'
instead of json dumped dictExpected behavior
bededict.to_json
should return actual json dumped dictSteps to reproduce
But if recast
benedict
todict
and back tobenedict
it works fineThe text was updated successfully, but these errors were encountered: