From the spec: "label_value can be any sequence of UTF-8 characters, but the backslash, the double-quote, and the line-feed characters have to be escaped as "\\", `\"`, and "\n", respectively."

You might also want to consider escaping newlines in docstrings if you don't protect against them somewhere in the code before.