1. Kirill Simonov
  2. libyaml
  3. Issues
Issue #6 new

pyyaml 3.10 can't dump dict

Christos Georgiou
created an issue
>>> import datetime, yaml
>>> yaml.dump({datetime.date.today(): 1, None: 2})
Traceback (most recent call last):
  File "<pyshell#67>", line 1, in <module>
    yaml.dump({ datetime.date.today(): 1, None: 2})
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 202, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 190, in dump_all
  File "/usr/lib/python2.7/dist-packages/yaml/representer.py", line 28, in represent
    node = self.represent_data(data)
  File "/usr/lib/python2.7/dist-packages/yaml/representer.py", line 57, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/usr/lib/python2.7/dist-packages/yaml/representer.py", line 223, in represent_dict
    return self.represent_mapping(u'tag:yaml.org,2002:map', data)
  File "/usr/lib/python2.7/dist-packages/yaml/representer.py", line 120, in represent_mapping
TypeError: can't compare datetime.date to NoneType

Comments (1)

  1. Log in to comment