alecthomas / alecthomas/voluptuous

MultipleInvalid error reporting path is unpredictable

オープン
#239 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
1.9k
フォーク
237
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。