gremond opened issue stove/rougail#1

gremond
Fri, 17 Nov 2023 14:34:34 +0100

1#Unexplicit error message#

I tried the example script in the doc,

While launching this script:

from rougail import Rougail, RougailConfig

RougailConfig['dictionaries_dir'] = ['dict']
rougail = Rougail()
config = rougail.get_config()
print(config.value.get())

with a false YAML format dictionnary:

version: '1.0'
variables:
- variable:
  - name: my_variable
    value:
    - text: my_value

That is, I have put the version: 1.0 in a YAML that is not an 1.0 format... My mistake...

Anyway, I had this error:

rougail (format_1_0 %=) $ p script.py
Traceback (most recent call last):
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/script.py", line 10, in <module>
    run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/script.py", line 7, in main
    config = await rougail.get_config()
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/__init__.py", line 53, in get_config
    tiram_obj = self.converted.save(self.rougailconfig['tiramisu_cache'])
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 829, in save
    self.annotate()
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 807, in annotate
    self.parse_directories()
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 733, in parse_directories
    self.parse_variable_file(filename,
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 770, in parse_variable_file
    self.family_or_variable(filename,
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 305, in family_or_variable
    typ = self.is_family_or_variable(path,
  File "/media/gwen/maxtor/gwen/entrepot/silique/workplace2/rougail/src/rougail/convert.py", line 255, in is_family_or_variable
    extra_keys = set(obj) - self.choice_attrs
TypeError: unhashable type: 'dict'

Wich seems to be, well, not very explicit.