alecthomas / alecthomas/voluptuous

MultipleInvalid error reporting path is unpredictable

Đang mở
#239 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.9k
Fork
237
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.