Re: [Qemu-devel] [PATCH 2/3] qmp.py: Encode json data before sending

2018-03-12 Thread Philippe Mathieu-Daudé
On 03/12/2018 07:55 PM, Eduardo Habkost wrote: > On Python 3, json.dumps() return a str object, which can't be > sent directly through a socket and must be encoded into a bytes > object. Use .encode('utf-8'), which will work on both Python 2 > and Python 3. > > Signed-off-by: Eduardo Habkost > -

Re: [Qemu-devel] [PATCH 2/3] qmp.py: Encode json data before sending

2018-03-12 Thread Daniel P . Berrangé
On Mon, Mar 12, 2018 at 03:55:02PM -0300, Eduardo Habkost wrote: > On Python 3, json.dumps() return a str object, which can't be > sent directly through a socket and must be encoded into a bytes > object. Use .encode('utf-8'), which will work on both Python 2 > and Python 3. > > Signed-off-by: Ed

[Qemu-devel] [PATCH 2/3] qmp.py: Encode json data before sending

2018-03-12 Thread Eduardo Habkost
On Python 3, json.dumps() return a str object, which can't be sent directly through a socket and must be encoded into a bytes object. Use .encode('utf-8'), which will work on both Python 2 and Python 3. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp.py | 2 +- 1 file changed, 1 insertion(+)