-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
A quoted string value that "looks like" an integer, bool or float value loses the quotes when emitted and so changes type and is no longer a string. The output from pyyaml is also shown for comparison; the values remain quoted.
$ cat lost-quotes.yaml
["true", "false", "3"]
$ cat lost-quotes.cpp
#include <cassert>
#include <iostream>
#include "yaml-cpp/yaml.h"
int main(int argc, char** argv)
{
char input[1024];
std::cin.getline(input, sizeof(input));
assert(std::cin.good());
std::cout << YAML::Load(input) << '\n';
return 0;
}
# build lost-quotes here ...
$ cat lost-quotes.yaml | build/debug/lost-quotes
[true, false, 3]
$ cat lost-quotes.yaml | python -c 'import sys; import yaml; print(yaml.safe_load(sys.stdin))'
['true', 'false', '3']
Metadata
Metadata
Assignees
Labels
No labels