alecthomas / alecthomas/voluptuous
MultipleInvalid error reporting path is unpredictable
- Lingua principale
- Python
- Stelle
- 1.9k
- Fork
- 237
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.