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

error in representer.py #12

Open
gpipelee opened this issue Mar 4, 2021 · 0 comments
Open

error in representer.py #12

gpipelee opened this issue Mar 4, 2021 · 0 comments

Comments

@gpipelee
Copy link

gpipelee commented Mar 4, 2021

Hi,

I'm using pyyaml 5.4.1, installed from pypi, and came across the error below. Could you perhaps help me understand what goes wrong?

Many thanks in advance.

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml_init_.py in dump(data, stream, Dumper, **kwds)
288 If stream is None, return the produced string instead.
289 """
--> 290 return dump_all([data], stream, Dumper=Dumper, **kwds)
291
292 def safe_dump_all(documents, stream=None, **kwds):

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml_init_.py in dump_all(documents, stream, Dumper, default_style, default_flow_style, canonical, indent, width, allow_unicode, line_break, encoding, explicit_start, explicit_end, version, tags, sort_keys)
276 dumper.open()
277 for data in documents:
--> 278 dumper.represent(data)
279 dumper.close()
280 finally:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent(self, data)
25
26 def represent(self, data):
---> 27 node = self.represent_data(data)
28 self.serialize(node)
29 self.represented_objects = {}

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml_init_.py in to_yaml(cls, dumper, data)
424 """
425 return dumper.represent_yaml_object(cls.yaml_tag, data, cls,
--> 426 flow_style=cls.yaml_flow_style)
427

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_yaml_object(self, tag, data, cls, flow_style)
226 else:
227 state = data.dict.copy()
--> 228 return self.represent_mapping(tag, state, flow_style=flow_style)
229
230 def represent_undefined(self, data):

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_mapping(self, tag, mapping, flow_style)
116 for item_key, item_value in mapping:
117 node_key = self.represent_data(item_key)
--> 118 node_value = self.represent_data(item_value)
119 if not (isinstance(node_key, ScalarNode) and not node_key.style):
120 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_list(self, data)
197 # break
198 #if not pairs:
--> 199 return self.represent_sequence('tag:yaml.org,2002:seq', data)
200 #value = []
201 #for item_key, item_value in data:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_sequence(self, tag, sequence, flow_style)
90 best_style = True
91 for item in sequence:
---> 92 node_item = self.represent_data(item)
93 if not (isinstance(node_item, ScalarNode) and not node_item.style):
94 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_dict(self, data)
205
206 def represent_dict(self, data):
--> 207 return self.represent_mapping('tag:yaml.org,2002:map', data)
208
209 def represent_set(self, data):

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_mapping(self, tag, mapping, flow_style)
116 for item_key, item_value in mapping:
117 node_key = self.represent_data(item_key)
--> 118 node_value = self.represent_data(item_value)
119 if not (isinstance(node_key, ScalarNode) and not node_key.style):
120 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_list(self, data)
197 # break
198 #if not pairs:
--> 199 return self.represent_sequence('tag:yaml.org,2002:seq', data)
200 #value = []
201 #for item_key, item_value in data:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_sequence(self, tag, sequence, flow_style)
90 best_style = True
91 for item in sequence:
---> 92 node_item = self.represent_data(item)
93 if not (isinstance(node_item, ScalarNode) and not node_item.style):
94 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml_init_.py in to_yaml(cls, dumper, data)
424 """
425 return dumper.represent_yaml_object(cls.yaml_tag, data, cls,
--> 426 flow_style=cls.yaml_flow_style)
427

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_yaml_object(self, tag, data, cls, flow_style)
226 else:
227 state = data.dict.copy()
--> 228 return self.represent_mapping(tag, state, flow_style=flow_style)
229
230 def represent_undefined(self, data):

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_mapping(self, tag, mapping, flow_style)
116 for item_key, item_value in mapping:
117 node_key = self.represent_data(item_key)
--> 118 node_value = self.represent_data(item_value)
119 if not (isinstance(node_key, ScalarNode) and not node_key.style):
120 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
46 data_types = type(data).mro
47 if data_types[0] in self.yaml_representers:
---> 48 node = self.yaml_representers[data_types[0]](self, data)
49 else:
50 for data_type in data_types:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_list(self, data)
197 # break
198 #if not pairs:
--> 199 return self.represent_sequence('tag:yaml.org,2002:seq', data)
200 #value = []
201 #for item_key, item_value in data:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_sequence(self, tag, sequence, flow_style)
90 best_style = True
91 for item in sequence:
---> 92 node_item = self.represent_data(item)
93 if not (isinstance(node_item, ScalarNode) and not node_item.style):
94 best_style = False

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_data(self, data)
50 for data_type in data_types:
51 if data_type in self.yaml_multi_representers:
---> 52 node = self.yaml_multi_representers[data_type](self, data)
53 break
54 else:

c:\users\gpipeleers.conda\envs\bp\lib\site-packages\yaml\representer.py in represent_object(self, data)
315 reduce = copyreg.dispatch_tablecls
316 elif hasattr(data, 'reduce_ex'):
--> 317 reduce = data.reduce_ex(2)
318 elif hasattr(data, 'reduce'):
319 reduce = data.reduce()

TypeError: reduce_ex() takes exactly one argument (0 given)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant