[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility |
Date: |
Wed, 20 Dec 2017 10:00:57 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Dec 19, 2017 at 02:34:18PM -0300, Philippe Mathieu-Daudé wrote:
> the socket API expects byte strings.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> scripts/qmp/qmp.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrange <address@hidden>
>
> diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py
> index 07c9632e9e..1080195e04 100644
> --- a/scripts/qmp/qmp.py
> +++ b/scripts/qmp/qmp.py
> @@ -166,7 +166,7 @@ class QEMUMonitorProtocol(object):
> """
> self.logger.debug(">>> %s", qmp_cmd)
> try:
> - self.__sock.sendall(json.dumps(qmp_cmd))
> + self.__sock.sendall(json.dumps(qmp_cmd).encode())
> except socket.error as err:
> if err[0] == errno.EPIPE:
> return
> --
> 2.15.1
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PATCH 0/9] iotests: python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 1/9] qemu.py: replace iteritems() by items() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- Re: [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 4/9] iotests: use octal numbers for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 5/9] iotests: replace xrange() by range() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19