Re: [Qemu-devel] [PATCH v2] Python3 Support for qmp.py

2017-07-13 Thread Ishani
- On Jul 7, 2017, at 4:31 PM, Daniel P. Berrange berra...@redhat.com wrote: > On Fri, Jul 07, 2017 at 12:38:47AM +0530, Ishani Chugh wrote: >> This patch intends to make qmp.py compatible with both python2 and python3. >> >> * Python 3 does not have dict.has_key(key), use key in dict instead

Re: [Qemu-devel] [PATCH v2] Python3 Support for qmp.py

2017-07-07 Thread Markus Armbruster
Ishani Chugh writes: > This patch intends to make qmp.py compatible with both python2 and python3. > > * Python 3 does not have dict.has_key(key), use key in dict instead > * Avoid line-based I/O since Python 2/3 have different character >encoding behavior. Explicitly encode/decode JSON UT

Re: [Qemu-devel] [PATCH v2] Python3 Support for qmp.py

2017-07-07 Thread Daniel P. Berrange
On Fri, Jul 07, 2017 at 12:38:47AM +0530, Ishani Chugh wrote: > This patch intends to make qmp.py compatible with both python2 and python3. > > * Python 3 does not have dict.has_key(key), use key in dict instead > * Avoid line-based I/O since Python 2/3 have different character >encoding beh

Re: [Qemu-devel] [PATCH v2] Python3 Support for qmp.py

2017-07-07 Thread Stefan Hajnoczi
On Fri, Jul 07, 2017 at 12:38:47AM +0530, Ishani Chugh wrote: Commit messages usually begin with a prefix indicating the affected component. This makes it easier for code reviewers and maintainers to browse email subjects and the git log. I recommend the following commit message: scripts/qmp:

[Qemu-devel] [PATCH v2] Python3 Support for qmp.py

2017-07-06 Thread Ishani Chugh
This patch intends to make qmp.py compatible with both python2 and python3. * Python 3 does not have dict.has_key(key), use key in dict instead * Avoid line-based I/O since Python 2/3 have different character encoding behavior. Explicitly encode/decode JSON UTF-8. * Replace print by print f