Repository navigation
Fix YAML deserialization of unicode - #38554
Merged
Merged
Conversation
This reverts commit 2405ff1. This never worked: * yaml_txt is stripped and never ends with a '\n' * len(string - 5) doesn't work * yaml.safe_dump() doesn't allow to set a custom Dumper() (see https://bitbucket.org/xi/pyyaml/src/10c55a624429f28191ef2bc1d9db44684946eb5d/lib/yaml/__init__.py?at=default&fileviewer=file-view-default#__init__.py-212 ) Also, #36611 for related bug and fix.
Contributor
|
Really nice! Thanks very much, @multani |
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.
What does this PR do?
This PR proposes a YAML deserializer for unicode values.
It also revert the patch from #30481 as it didn't fix the original problem in #30454 and it's actually broken code since the very beginning (see commit f7712d4 for more info)
What issues does this PR fix or reference?
Fixes #30454
Previous Behavior
When using the
yamlfilter, Python's unicode values would be serialized as!!python/unicode ...which was not understood by the YAML parser.New Behavior
The YAML parser is now able to properly deserialize these YAML tagged values.
Tests written?
Yes
Please review Salt's Contributing Guide for best practices.