qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Cleber Rosa <crosa@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Subject: [Qemu-devel] [PULL 09/21] scripts: ensure signrom treats data as bytes
Date: Mon,  5 Feb 2018 21:08:48 -0200	[thread overview]
Message-ID: <20180205230900.11344-10-ehabkost@redhat.com> (raw)
In-Reply-To: <20180205230900.11344-1-ehabkost@redhat.com>

From: "Daniel P. Berrange" <berrange@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20180116134217.8725-10-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 scripts/signrom.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/signrom.py b/scripts/signrom.py
index d1dabe0240..0497a1c32e 100644
--- a/scripts/signrom.py
+++ b/scripts/signrom.py
@@ -18,7 +18,7 @@ fin = open(sys.argv[1], 'rb')
 fout = open(sys.argv[2], 'wb')
 
 magic = fin.read(2)
-if magic != '\x55\xaa':
+if magic != b'\x55\xaa':
     sys.exit("%s: option ROM does not begin with magic 55 aa" % sys.argv[1])
 
 size_byte = ord(fin.read(1))
@@ -33,7 +33,7 @@ elif len(data) < size:
     # Add padding if necessary, rounding the whole input to a multiple of
     # 512 bytes according to the third byte of the input.
     # size-1 because a final byte is added below to store the checksum.
-    data = data.ljust(size-1, '\0')
+    data = data.ljust(size-1, b'\0')
 else:
     if ord(data[-1:]) != 0:
         sys.stderr.write('WARNING: ROM includes nonzero checksum\n')
-- 
2.14.3

  parent reply	other threads:[~2018-02-05 23:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 23:08 [Qemu-devel] [PULL 00/21] Python queue, 2018-02-05 Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 01/21] qapi: convert to use python print function instead of statement Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 02/21] qapi: use items()/values() intead of iteritems()/itervalues() Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 03/21] qapi: Use OrderedDict from standard library if available Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 04/21] qapi: adapt to moved location of StringIO module in py3 Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 05/21] qapi: Adapt to moved location of 'maketrans' function " Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 06/21] qapi: remove '-q' arg to diff when comparing QAPI output Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 07/21] qapi: ensure stable sort ordering when checking QAPI entities Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 08/21] qapi: force a UTF-8 locale for running Python Eduardo Habkost
2018-02-05 23:08 ` Eduardo Habkost [this message]
2018-02-05 23:08 ` [Qemu-devel] [PULL 10/21] configure: allow use of python 3 Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 11/21] qemu.py: remove unused import Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 12/21] qemu.py: better control of created files Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 13/21] qemu.py: refactor launch() Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 14/21] qemu.py: always cleanup on shutdown() Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 15/21] qemu.py: use poll() instead of 'returncode' Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 16/21] qemu.py: cleanup redundant calls in launch() Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 17/21] qemu.py: don't launch again before shutdown() Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 18/21] input: add missing JIS keys to virtio input Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 19/21] ui: update keycodemapdb to get py3 fixes Eduardo Habkost
2018-02-05 23:08 ` [Qemu-devel] [PULL 20/21] travis: improve python version test coverage Eduardo Habkost
2018-02-05 23:09 ` [Qemu-devel] [PULL 21/21] docker: change Fedora images to run with python3 Eduardo Habkost
2018-02-07 12:07 ` [Qemu-devel] [PULL 00/21] Python queue, 2018-02-05 Peter Maydell

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=20180205230900.11344-10-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).