# HG changeset patch # User Goffi # Date 1511105915 -3600 # Node ID e86dc8cb4345da856d23d4c23107bacc79406600 # Parent 51d346e283fdcf4b6de8cc0ef4c546e34ceb947c jp (debug/monitor): if data can't be parsed (happen at beginning/end of stream because it's not complete XML), it is printed directly. diff -r 51d346e283fd -r e86dc8cb4345 frontends/src/jp/cmd_debug.py --- a/frontends/src/jp/cmd_debug.py Sat Nov 18 18:49:57 2017 +0100 +++ b/frontends/src/jp/cmd_debug.py Sun Nov 19 16:38:35 2017 +0100 @@ -138,7 +138,16 @@ if whiteping: self.disp('[WHITESPACE PING]') else: - self.output(xml_data) + try: + self.output(xml_data) + except Exception: + # initial stream is not valid XML, + # in this case we print directly to data + # FIXME: we should test directly lxml.etree.XMLSyntaxError + # but importing lxml directly here is not clean + # should be wrapped in a custom Exception + self.disp(xml_data) + self.disp(u'') def start(self): self.host.bridge.register_signal('xmlLog', self.printXML, 'plugin')