4 ms·
If the yaml is generated by code it should be quoted automatically, given that you have a sane yaml library. try this: yaml.dump({"gameServerVersion": "55
by Too 2y ago
If the yaml is generated by code it should be quoted automatically, given that you have a sane yaml library.
try this:
yaml.dump({"gameServerVersion": "556474378"}, sys.stdout)
It will correctly print the quoted version
gameServerVersion: '556474378'
At least with Python, strings are strings and there is a minimal risk you store a git hash coming from the output of a git subprocess command as a number. The only way this bug could have happened is if doing manual string templating. If you were doing that, equally or worse kind of bugs are waiting for you in any serialization format.
- IshKebab 2y ago> The only way this bug could have happened is if doing manual string templating. I agree you should not do that, but it is common in the YAML world - if you're using YAML you've already decided you don't care if things are reliable. Given that they were using string templating, this would have been caught earlier using a different format. Of course there are other string templating mistakes that other formats would not catch (e.g. forgetting to escape strings), but they are still better than YAML.