[ovirt-devel] vdsm: python3 support?

Dan Kenigsberg danken at redhat.com
Mon Apr 27 15:42:55 UTC 2015


Vdsm depends on Python 2, but the developers of Python 2 wants us (and
everybody else) to move to the slightly-different language of Python 3.

There is a lot to be fixed for this to happen:
- depency on libraries with no python3 port:
  - mom
  - cpopen
  - m2crypto
- use of implicit relative imports, mostly in the storage package
- use of renamed/moved functions, methods and modules (e.g.
  dict.iteritems, io.StringIO, itertools.izip)
- use of contextlib.nested
- unsafe unicode treatment
- and probably much more...

Fixing it all would take a long time, and may introduce regressions. We
must perform it gradually.

The very first step is to use syntax that is compatible with both
languages, and make sure we do not regress on that front. The remaining
bit is our usages of

    raise E, V, T

statement, which has been dropped in PEP-3109.

https://gerrit.ovirt.org/#/c/40214/ suggests to replace it with
six.reraise(), which adds a new run-time dependency to Vdsm.

https://gerrit.ovirt.org/#/c/40215/ adds an attempt to python3-compile
all vdsm code, so that we do not introduce new python2-only code.

Please approve/comment!



More information about the Devel mailing list