From: W. Trevor King Date: Sun, 12 Jul 2009 13:05:05 +0000 (-0400) Subject: Not escaping whitespace (e.g. endlines) outside the XML document root. X-Git-Tag: 1.0.0~64^2~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e757fd3eb3a600a919b9d1542bc68c3a4e9ae939;p=be.git 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 ;). --- 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(