Not escaping whitespace (e.g. endlines) outside the XML document root.
authorW. Trevor King <wking@drexel.edu>
Sun, 12 Jul 2009 13:05:05 +0000 (09:05 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 12 Jul 2009 13:05:05 +0000 (09:05 -0400)
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

index c4b074f0b10cb1bfd16f834c5fcee0c90a8aa6ab..9a1e2ec063e9056f85c30290b100fd366534ea2e 100644 (file)
@@ -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(