When pasting this YAML file into an online yaml parser, I got an expected block end error:
ADDATTEMPTING: \'Tentative d ajout \' ATTEMPTINGTOGIVE: \'Tenter de do
In my case, the error occured when I tried to pass a variable which was looking like a bytes-object (b"xxxx") but was actually a string.
You can convert the string to a real bytes object like this:
foo.strip('b"').replace("\\n", "\n").encode()