ruamel.yaml.representer.RepresenterError: cannot represent an object: {'b': 123}
```
Traceback (most recent call last):
File "", line 1, in
File "box/box.py", line 1013, in box.box.Box.to_yaml
File "box/converters.py", line 207, in box.converters._to_yaml
File "box/converters.py", line 208, in box.converters._to_yaml
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/main.py", line 594, in dump
return self.dump_all([data], stream, transform=transform)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/main.py", line 604, in dump_all
self._context_manager.dump(data)
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/main.py", line 953, in dump
self._yaml.representer.represent(data)
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 83, in represent
node = self.represent_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 105, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 318, in represent_dict
return self.represent_mapping('tag:yaml.org,2002:map', data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 841, in represent_mapping
node_value = self.represent_data(item_value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 105, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 309, in represent_list
return self.represent_sequence('tag:yaml.org,2002:seq', data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 750, in represent_sequence
node_item = self.represent_data(item)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 115, in represent_data
node = self.yaml_representers[None](self, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daniel/.local/share/virtualenvs/bedrock-JuU-uWSt/lib/python3.11/site-packages/ruamel/yaml/representer.py", line 347, in represent_undefined
raise RepresenterError(f'cannot represent an object: {data!s}')
ruamel.yaml.representer.RepresenterError: cannot represent an object: {'b': 123}
```
Investigation
The problem is that - when using frozen_box=True - that lists get converted to tuples. But then test_box.to_dict() does not remove the Boxes from tuples so we have this:
Bug
Simple example
This yields the following error:
ruamel.yaml.representer.RepresenterError: cannot represent an object: {'b': 123}
``` Traceback (most recent call last): File "Investigation
The problem is that - when using frozen_box=True - that lists get converted to tuples. But then
test_box.to_dict()
does not remove the Boxes from tuples so we have this:which should actually be this: