<div dir="ltr"><div class="gmail_extra">On 25 September 2015 at 07:33,  <span dir="ltr">&lt;<a href="mailto:mariano.lopez@linux.intel.com" target="_blank">mariano.lopez@linux.intel.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":6ny" class="a3s" style="overflow:hidden">     def log(self, msg):<br>
         if self.logfile:<br>
+            # It is needed to sanitize the data received from qemu<br>
+            # because is possible to have control characters or Unicode<br>
+            msg = cmdline = &quot;&quot;.join(filter(lambda x:x in string.printable, msg))<br>
             with open(self.logfile, &quot;a&quot;) as f:<br>
                 f.write(&quot;%s&quot; % msg)</div></blockquote></div><br>cmdline looks like a copy/paste typo?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Would it be sensible in the future to support UTF-8 for the logging?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ross</div></div>