-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use Yaml instead of JSON #3426
Use Yaml instead of JSON #3426
Conversation
da73123
to
67a5c8c
Compare
JSON return unicode strings under Python2, even if this is a better behavior it would be a breaking change compare to the previous version of the Agent not using this lib to embed Python. Yaml returns bytes under Python2 and Unicode under Python3. Since JSON is a subset of Yaml we use 'yaml' here.
99f2dac
to
bacf7a0
Compare
// of the Agent not using this lib to embed Python. Yaml returns bytes | ||
// under Python2 and Unicode under Python3. Since JSON is a subset of Yaml | ||
// we use 'yaml' here. | ||
char module_name[] = "yaml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON is indeed a subset of YAML 1.2. However I am not 100% sure if pyyaml implements 1.2 guidelines:
yaml/pyyaml#116
YAML 1.2 changes were mainly about dealing with some corner case that made YAML "kind of" a superset of JSON. diff are highlighted here: https://github.com/yaml/yaml/wiki/YAML-1.2-Changelog. I think there is a chance we might hit some of them. WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We completely control the data between the agent and six. It's serialized by the agent and loaded by six
so we know that escaped /
would not happened (which is the only one we care about).
But you raise a good point, since we control the whole chain why not use YAML everywhere !
I open another PR (#3468) with the whole change.
Will be merged as part of #3468 |
What does this PR do?
JSON return unicode strings under Python2, even if this is a better
behavior it would be a breaking change compare to the previous version
of the Agent not using this lib to embed Python. Yaml returns bytes
under Python2 and Unicode under Python3. Since JSON is a subset of Yaml
we use 'yaml' here.