Comment 1 for bug 1071265

Revision history for this message
Javier Collado (javier.collado) wrote :

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.