Broken dotenv output for values with spaces
Strings containing spaces are not quoted nor escaped in output dotenv files. The only way I've found to produce proper dotenv files in such case is manually quoting each space in the source yaml as quoting isn't possible (related issue #949).
To reproduce
# BAD
$ echo -e "FOO: Some long string with spaces" | sops encrypt --filename-override .yaml | sops decrypt --filename-override .yaml --output-type dotenv
FOO=Some long string with spaces
# BAD
$ echo -e "FOO: 'Some long string with spaces'" | sops encrypt --filename-override .yaml | sops decrypt --filename-override .yaml --output-type dotenv
FOO=Some long string with spaces
# GOOD
$ echo -e "FOO: Some\ long\ string\ with\ spaces" | sops encrypt --filename-override .yaml | sops decrypt --filename-override .yaml --output-type dotenv
FOO=Some\ long\ string\ with\ spaces
Expected behavior
$ echo -e "FOO: Some long string with spaces" | sops encrypt --filename-override .yaml | sops decrypt --filename-override .yaml --output-type dotenv
FOO="Some long string with spaces"
The problem with dotenv is that there is no proper definition of dotenv. Everyone has slightly different expectations of what it means. For some reason the original developer implemented the thing we now have, which is unfortunately different from what many people assume dotenv would be, and we can't change it for backwards compatibility reasons without breaking many other users who arranged with the current way. So this isn't a bug, but behaving as designed.
See #1435 for more details, including links to PRs which attempted to change this (including one that got merged and hat to be reverted). I also tried starting a discussion in that issue of how this could be fixed without breaking backwards compatibility, but so far nobody else participated.