Add Python 3 support to Solum

Registered by Victor Stinner

It’s time to add Python 3 support to Solum by generalizing the usage of the six module, in addition to the Python 2 support.

The goal is to make Solum compatible with Python 3 at the end of the Liberty cycle.

For the rationale, the plan and work items, please see Nova Python 3 spec, since it's almost the same for Solum:

Summary of the plan:

* Write a few bunch of patches to fix the most obvious Python 3 syntax issues (dict.iteritems, 123L, reraise an exception, etc.) to be able to load unit tests
* Find a subset of unit tests which pass on Python 3.4 and add a py34 target in tox.ini to run them.
* Add a non-voting py34 check job running tox -e py34
* When the py34 check job becomes stable enough, make it voting. At this point, it's no more possible to add regressions on the Python 3 in the tests executed by tox -e py34
* Fix remaining tests one by one, each time add it to the py34 target of tox.ini

For more information on Python 3, see the wiki page:

Blueprint information

Not started
Devdatta Kulkarni
Victor Stinner
Victor Stinner
Series goal:
Milestone target:
milestone icon next-mitaka

Related branches



Gerrit topic:,topic:bp/solum-python3,n,z

Addressed by:
    py3: Replace unicode with six.text_type

Addressed by:
    py3: Get httplib and __builtin__ from six.moves

Addressed by:
    py3: Get urllib and urlparse from six.moves

Addressed by:
    py3: Replace dict.iteritems() with dict.items()

Addressed by:
    py3: Replace types.BooleanType with bool

Addressed by:
    Replace string.letters with string.ascii_letters

Addressed by:
    py3: MultiType.validate() now catchs TypeError

Addressed by:
    py3: Stop using StandardError exception

Addressed by:
    Use @six.python_2_unicode_compatible decorator

Addressed by:
    py3: Replace exc.message with str(exc)

Addressed by:
    py3: Fix using map() for python2,3 compatibility

Addressed by:
    py3: Fix using filter() for python2,3 compatibility


Work Items

This blueprint contains Public information 
Everyone can see this information.