-
Notifications
You must be signed in to change notification settings - Fork 428
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
Replace number stringification hack with custom YAML loader #4183
Conversation
3b5467b
to
fae6188
Compare
Yay! All done here! @mingwandroid - no rush just let me know if anything here needs further work/discussion. |
@kenodegard You identified a few cases that were previously missing, could you turn those cases into test cases please? |
Absolutely! I will need to revive some dormant brain cells first... I'm assuming we'd want the tests written in |
fae6188
to
5901350
Compare
@jezdez added a few simple tests that are just checking to see if any int/floats occur in the parsed yaml. The zero, positive, and negative tests all fail on master. |
@anaconda-issue-bot check |
Instead of monkeypatching the yaml Loader in an attempt to avoid parsing numbers make a custom Loader where the float/int tags are entirely removed.
5901350
to
dd6bfcb
Compare
This change was prompted by issues identified in #4179.
Instead of monkeypatching the yaml Loader every time it is used in an attempt to avoid parsing numbers make a custom Loader where the float/int tags are entirely removed.
This change also catches a number of cases that were previously missed. For example, pyyaml defined float resolvers for "-+0123456789." and int resolvers for "-+0123456789" and since the prior implementation only monkeypatched for "0123456789" it was still possible for numbers to be missed (e.g. ".0", "-1", "+1").