Unexplicit error message #1

Open
opened 2023-11-17 14:34:34 +01:00 by gremond · 0 comments
Member

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.

I tried the example script in the doc, While launching this script: ```cat script.py 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: ```cat dict/00-base.yml 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.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stove/rougail#1
No description provided.