Pin PyYAML and add a test for a trailing tab#315
Merged
Conversation
Comment on lines
+28
to
+29
| except ImportError: # pragma: no cover | ||
| from yaml import SafeLoader as Loader # pragma: no cover |
Contributor
There was a problem hiding this comment.
Does the test pass if SafeLoader is used instead of CSafeLoader? Perhaps we should check both - or if SafeLoader doesn't work, should we reconsider whether we should use it in the main code?
Member
Author
There was a problem hiding this comment.
Thanks for the comment. I've added a test that SafeLoader raises a yaml.scanner.ScannerError. This bug might be fixed in a future PyYAML version, then the test would fail if we upgraded the PyYAML version in requirements.txt. But now that PyYAML v5.4.1 includes the LibYAML extension in the Python wheel, I don't see a reason to use pure-Python PyYAML (which is also slower), so I've removed usage of SafeLoader etc. throughout the code.
* Use only the LibYAML extension included with PyYAML v5.4.1.
alisonrclarke
approved these changes
Feb 24, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #314.