alecthomas / alecthomas/voluptuous

MultipleInvalid error reporting path is unpredictable

Ouverte
#239 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
1.9k
Forks
237
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I've been trying to debug an unpredictable failure in some of my code, which I'll attach. Sometimes when I run this I get the following traceback:

```
% python3 bug.py
Traceback (most recent call last):
File "bug.py", line 201, in
main()
File "bug.py", line 198, in main
GadgetYAML(yaml)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 192, in __call__
return self._compiled([], data)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 324, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['volumes']['first-image']['structure'][0]['content'][0]['offset-write']
```

Other times I get this traceback:

```
% python3 bug.py
Traceback (most recent call last):
File "bug.py", line 201, in
main()
File "bug.py", line 198, in main
GadgetYAML(yaml)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 192, in __call__
return self._compiled([], data)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 486, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/lib/python3/dist-packages/voluptuous/schema_builder.py", line 324, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['volumes']['first-image']['structure'][0]['content'][0]['image']
```

Notice that the path reported is different. You may have to run the script multiple times to see the difference as it appears to be completely random. I don't *think* it's related to PYTHONHASHSEED since the randomness is still present when I explicitly set PYTHONHASHSEED.

Ubuntu 16.10; Python 3.5.2+; voluptuous 0.9.3

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.