The problem is that yaml doesn't serialize as literal string those that have whitespace characters before a newline character as in the following example:
>>> import yaml >>> print yaml.dump('hello world\n', default_style='|') | hello world
>>> print yaml.dump('hello world \n', default_style='|') "hello world \n"
The solution would be to make sure that whitespace is removed, so that the strings are serialized as expected.
The problem is that yaml doesn't serialize as literal string those that have whitespace characters before a newline character as in the following example:
>>> import yaml
>>> print yaml.dump('hello world\n', default_style='|')
|
hello world
>>> print yaml.dump('hello world \n', default_style='|')
"hello world \n"
The solution would be to make sure that whitespace is removed, so that the strings are serialized as expected.