From e757fd3eb3a600a919b9d1542bc68c3a4e9ae939 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 12 Jul 2009 09:05:05 -0400 Subject: [PATCH] Not escaping whitespace (e.g. endlines) outside the XML document root. ElementTree.XML was choking on them. I should unescape all whitespace (e.g. tabs, etc.), but I'm lazy and don't have any XML that's strange enough to need it ;). --- becommands/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/becommands/comment.py b/becommands/comment.py index c4b074f..9a1e2ec 100644 --- a/becommands/comment.py +++ b/becommands/comment.py @@ -117,7 +117,7 @@ def execute(args, test=False): new.content_type = options.content_type else: # import XML comment [list] # read in the comments - str_body = body.strip().encode("unicode_escape") + str_body = body.encode("unicode_escape").replace(r'\n', '\n') comment_list = ElementTree.XML(str_body) if comment_list.tag not in ["bug", "comment-list"]: raise comment.InvalidXML( -- 2.26.2