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
If I try to dump a dottedDict via yaml.dump I get a KeyError.
yaml.dump
KeyError
To reproduce the behavior I use the following code:
#!/usr/bin/env python import yaml from dotted.utils import dot path = 'foo.bar.baz' data = dict(foo=dict(bar=dict(baz='blafasel'))) data = dot(data) print(data) print(data[path]) print(yaml.dump(data))
If you run this script the following Execption is raised:
$ ./travers_to_dict.py {'foo': {'bar': {'baz': 'blafasel'}}} blafasel Traceback (most recent call last): File "./travers_to_dict.py", line 15, in <module> print(yaml.dump(data)) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/yaml/__init__.py", line 290, in dump return dump_all([data], stream, Dumper=Dumper, **kwds) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/yaml/__init__.py", line 278, in dump_all dumper.represent(data) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/yaml/representer.py", line 27, in represent node = self.represent_data(data) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/yaml/representer.py", line 52, in represent_data node = self.yaml_multi_representers[data_type](self, data) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/yaml/representer.py", line 317, in represent_object reduce = data.__reduce_ex__(2) File "/home/nero/.pyenv/versions/traverse_to_dict/lib/python3.8/site-packages/dotted/collection.py", line 266, in __getitem__ return self.store[key] KeyError: '__getstate__'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If I try to dump a dottedDict via
yaml.dump
I get aKeyError
.To reproduce the behavior I use the following code:
If you run this script the following Execption is raised:
The text was updated successfully, but these errors were encountered: