Skip to content

docker: Port to Python 3

Eduardo Habkost qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6docker: Use BytesIO instead of StringIOtests/docker/docker.py+6 -90 replies
2/6docker: Always return int on run()tests/docker/docker.py+2 -10 replies
3/6docker: Add type annotationstests/docker/docker.py+37 -70 replies
4/6docker: Use os.environ.items() instead of .iteritems()tests/docker/docker.py+1 -11 reply
5/6docker: Make _get_so_libs() work on Python 3tests/docker/docker.py+12 -30 replies
6/6docker: Open dockerfiles in text modetests/docker/docker.py+26 -202 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/6
2/6
3/6
4/6R-b
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/6] docker: Port to Python 3

This series makes tests/docker/docker.py compatible with both Python 2 and Python 3, and adds type annotation to make maintenance easier in the future.

A note about dockerfile encoding
--------------------------------

One decision I made while working on this was to open dockerfiles in text mode instead of binary mode, to make the code simpler and safer.

This means we won't support dockerfiles that are not valid utf-8 data, but I see that as a feature and not a bug. :)

Opening dockerfiles in binary mode and treating its contents as byte sequences instead of text is possible if we really want to, but I don't think it would be worth the extra code complexity.

Eduardo Habkost (6):
docker: Use BytesIO instead of StringIO
docker: Always return int on run()
docker: Add type annotations
docker: Use os.environ.items() instead of .iteritems()
docker: Make _get_so_libs() work on Python 3
docker: Open dockerfiles in text mode

 tests/docker/docker.py | 115 ++++++++++++++++++++++++++++-------------
 1 file changed, 79 insertions(+), 36 deletions(-)

base-commit: bd4e4a387aa733e40270a7406c7d111f2292de65
prerequisite-patch-id: 83051ebcf718afae38540902b60a0f8e9f91c174
prerequisite-patch-id: 1a35c71f2a58523de78e3ea2e44c5ef1f84bcc4a
prerequisite-patch-id: 5206b4c5a6797ea17eb763da6203e1881d379f2c

Signature · 1 line
2.18.0.rc1.1.g3f1ff2140