-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error reporting is limited when dict key is unhashable #17
Comments
What version(s)? Can not reproduce with oyaml v0.8 / PyYAML 5.1 / Python 3.7.2 (linux). I get the same richer exception context for both pyyaml and oyaml. Edit: I can reproduce it on 2.7 |
Anything before 3.6 I expect. oyaml doesn't patch the Loader after that. |
Hmm, it's not really amenable to monkeypatching here since the mapping type is just a literal in the local scope. I really need |
Yes, it's a pain. You have to choose between inefficiency and reimplementing a bunch of internal logic :( |
There could also be an ast rewrite 😈 |
If you attempt to parse code that contains a mapping with an unhashable key, yaml raises a ConstructorError that tells the user exactly where the issue was. However, oyaml raises a TypeError, which may be missed by exception handling code expecting a ConstructorError, and which contains no information about where the problem occurred.
The text was updated successfully, but these errors were encountered: