You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Load YAML values like 10:30 as strings instead of base 60 numbers - #1008
PyYAML implements YAML 1.1, which resolves values like 10:30 and 10:30:00.5 as sexagesimal (base 60) numbers, i.e. 630 and 37800.5. Because of this, times could not be parsed as datetime.time when given in a config file or inside a list, and with Union[int, time] they silently became integers.
This pull request removes the sexagesimal resolution from the default YAML loader, so such values are loaded as strings, as in YAML 1.2. Other number formats are not changed.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f4b420a) to head (71be412).
✅ All tests successful. No failed tests found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingrefactorImprovements to the quality of the code
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
PyYAML implements YAML 1.1, which resolves values like
10:30and10:30:00.5as sexagesimal (base 60) numbers, i.e.630and37800.5. Because of this, times could not be parsed asdatetime.timewhen given in a config file or inside a list, and withUnion[int, time]they silently became integers.This pull request removes the sexagesimal resolution from the default YAML loader, so such values are loaded as strings, as in YAML 1.2. Other number formats are not changed.
Before submitting