<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 09/28/2015 09:42 AM, Burton, Ross
wrote:<br>
</div>
<blockquote
cite="mid:CAJTo0LaSKjRjqR5D74W5TtJrPBEjhendtkk=iPDrJYPHqhdEkw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">On 25 September 2015 at 07:33, <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:mariano.lopez@linux.intel.com"
target="_blank">mariano.lopez@linux.intel.com</a>></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 = "".join(filter(lambda x:x
in string.printable, msg))<br>
with open(self.logfile, "a") as f:<br>
f.write("%s" % msg)</div>
</blockquote>
</div>
<br>
cmdline looks like a copy/paste typo?</div>
</div>
</blockquote>
<br>
Yes it is a copy/paste typo, I'll send a v2<br>
<br>
<blockquote
cite="mid:CAJTo0LaSKjRjqR5D74W5TtJrPBEjhendtkk=iPDrJYPHqhdEkw@mail.gmail.com"
type="cite">
<div dir="ltr">
<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>
</blockquote>
<br>
Yes, it would be possible to use UTF-8, but the main reason to use
printable is not Unicode characters, it is the NULL character that
sometimes appear in the qemu output and always appear in the command
used to run qemu. Actually, the only non ASCII character that
appears is the copyright symbol.<br>
<br>
<blockquote
cite="mid:CAJTo0LaSKjRjqR5D74W5TtJrPBEjhendtkk=iPDrJYPHqhdEkw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Ross</div>
</div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
Mariano Lopez</div>
</body>
</html>