id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc
179	Python-yaml crashes on unhashable key	Samuel.Hym@…	xi	"Hello,

Python-yaml (debian version 3.09-5 of python-yaml, on python 2.6.6) refuses to load a yaml document containing a unhashable element as a key.

For example :

{{{
>>> yaml.load('[]: a')

Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/usr/lib/python2.6/dist-packages/yaml/__init__.py"", line 58, in load
    return loader.get_single_data()
  File ""/usr/lib/python2.6/dist-packages/yaml/constructor.py"", line 44, in get_single_data
    return self.construct_document(node)
  File ""/usr/lib/python2.6/dist-packages/yaml/constructor.py"", line 53, in construct_document
    for dummy in generator:
  File ""/usr/lib/python2.6/dist-packages/yaml/constructor.py"", line 403, in construct_yaml_map
    value = self.construct_mapping(node)
  File ""/usr/lib/python2.6/dist-packages/yaml/constructor.py"", line 213, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File ""/usr/lib/python2.6/dist-packages/yaml/constructor.py"", line 137, in construct_mapping
    ""found unacceptable key (%s)"" % exc, key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unacceptable key (unhashable type: 'list')
  in ""<string>"", line 1, column 1:
    []: a
    ^
}}}

I don't know what would be the most desirable python object to build for that kind of yaml source, though :/

Best regards

Samuel Hym"	defect	closed	normal	pyyaml	normal	duplicate		
