Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mariano Lopez <mariano.lopez@linux.intel.com>
To: "Burton, Ross" <ross.burton@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] qemurunner: Sanitize output from qemu and qemu pid
Date: Mon, 28 Sep 2015 15:02:25 -0500	[thread overview]
Message-ID: <56099CD1.1090909@linux.intel.com> (raw)
In-Reply-To: <CAJTo0LaSKjRjqR5D74W5TtJrPBEjhendtkk=iPDrJYPHqhdEkw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]



On 09/28/2015 09:42 AM, Burton, Ross wrote:
> On 25 September 2015 at 07:33, <mariano.lopez@linux.intel.com 
> <mailto:mariano.lopez@linux.intel.com>> wrote:
>
>      def log(self, msg):
>              if self.logfile:
>     +            # It is needed to sanitize the data received from qemu
>     +            # because is possible to have control characters or
>     Unicode
>     +            msg = cmdline = "".join(filter(lambda x:x in
>     string.printable, msg))
>                  with open(self.logfile, "a") as f:
>                      f.write("%s" % msg)
>
>
> cmdline looks like a copy/paste typo?

Yes it is a copy/paste typo, I'll send a v2

>
> Would it be sensible in the future to support UTF-8 for the logging?

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.

>
> Ross

-- 
Mariano Lopez

[-- Attachment #2: Type: text/html, Size: 2806 bytes --]

      reply	other threads:[~2015-09-28 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1443162720.git.mariano.lopez@linux.intel.com>
2015-09-25  6:33 ` [PATCH 1/1] qemurunner: Sanitize output from qemu and qemu pid mariano.lopez
2015-09-28 14:42   ` Burton, Ross
2015-09-28 20:02     ` Mariano Lopez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56099CD1.1090909@linux.intel.com \
    --to=mariano.lopez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox