Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Disallow surrogate escapes in dicts and lists in the config
In Dict.to_str() and List.to_str() we use json.dump to get a value. However, JSON includes surrogate escapes in the dumped values, which breaks round trips. >>> yaml.load(json.dumps({'\U00010000': True})) {'\ud800\udc00': True} >>> yaml.load(json.dumps({'\U00010000': True}, ensure_ascii=False)) yaml.reader.ReaderError: unacceptable character #x10000: special characters are not allowed See: https://stackoverflow.com/a/38552626/2085149 https://news.ycombinator.com/item?id=12798032
- Loading branch information
1 parent
fa0f4e1
commit 9ac2dbc
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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