[Qemu-devel] [PATCH 0/9] iotests: python3 compatibility

Philippe Mathieu-Daudé posted 9 patches 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171219173425.8113-1-f4bug@amsat.org
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
scripts/qemu.py               |  2 +-
scripts/qmp/qmp.py            |  2 +-
tests/qemu-iotests/041        |  6 +++---
tests/qemu-iotests/044        | 14 +++++++-------
tests/qemu-iotests/065        |  4 ++--
tests/qemu-iotests/093        |  2 +-
tests/qemu-iotests/096        |  4 ++--
tests/qemu-iotests/118        | 28 ++++++++++++++--------------
tests/qemu-iotests/136        |  2 +-
tests/qemu-iotests/139        |  2 +-
tests/qemu-iotests/149        |  3 ++-
tests/qemu-iotests/163        |  2 +-
tests/qemu-iotests/165        |  3 ++-
tests/qemu-iotests/iotests.py | 14 +++++++++-----
14 files changed, 47 insertions(+), 41 deletions(-)
[Qemu-devel] [PATCH 0/9] iotests: python3 compatibility
Posted by Philippe Mathieu-Daudé 6 years, 4 months ago
Hi,

This is a very boring series.

I a later series I refactor the iotests.py class, however when the first version
of series [1] was posted I received comments that this class should no support
Python 3.

I didn't tested with very old CentOS release, but this should work with Python
versions >= 2.6.0a2.

Note: in today's IRC chat we suggest to drop Python 2 support for block iotests,
continuing to support it for common scripts used by the build system.

I'm not a Python expert, so I'll be very happy/relieved if someone is willing to
fix/continue/improve this series :)

Regards,

Phil.

[1]: http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02339.html

Philippe Mathieu-Daudé (9):
  qemu.py: replace iteritems() by items() for python3 compatibility
  qmp.py: encode JSON unicode as byte strings for python3 compatibility
  iotests: replace print statement by print() function for python3
    compatibility
  iotests: use octal numbers for python3 compatibility
  iotests: replace xrange() by range() for python3 compatibility
  iotests: replace dict.has_key() by 'in' operator for python3
    compatibility
  iotests: replace lambda function by lambda expression for python3
    compatibility
  iotests: replace assertEquals() by assertEqual() for python3
    compatibility
  iotests.py: use io.StringIO with python3

 scripts/qemu.py               |  2 +-
 scripts/qmp/qmp.py            |  2 +-
 tests/qemu-iotests/041        |  6 +++---
 tests/qemu-iotests/044        | 14 +++++++-------
 tests/qemu-iotests/065        |  4 ++--
 tests/qemu-iotests/093        |  2 +-
 tests/qemu-iotests/096        |  4 ++--
 tests/qemu-iotests/118        | 28 ++++++++++++++--------------
 tests/qemu-iotests/136        |  2 +-
 tests/qemu-iotests/139        |  2 +-
 tests/qemu-iotests/149        |  3 ++-
 tests/qemu-iotests/163        |  2 +-
 tests/qemu-iotests/165        |  3 ++-
 tests/qemu-iotests/iotests.py | 14 +++++++++-----
 14 files changed, 47 insertions(+), 41 deletions(-)

-- 
2.15.1


Re: [Qemu-devel] [PATCH 0/9] iotests: python3 compatibility
Posted by Paolo Bonzini 6 years, 4 months ago
On 19/12/2017 18:34, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> This is a very boring series.
> 
> I a later series I refactor the iotests.py class, however when the first version
> of series [1] was posted I received comments that this class should no support
> Python 3.
> 
> I didn't tested with very old CentOS release, but this should work with Python
> versions >= 2.6.0a2.

Thanks, this is useful.  However, it'd be much easier if the commit
messages showed the actual error message that is fixed, or an example.

Paolo