Python 3 compatibility

Registered by ChangBo Guo(gcb)

This blueprint has been superseded. See the newer blueprint "Get Keystone Running in Python 3" for updated plans.

We will move to Python 3 in the future. More and more openstack projects are Python 3 compatible, especially the new stackforge projects. This main idea of this blueprint is using library six [1] to make the Keystone codes run both in Python 2 and Python 3.


Blueprint information

ChangBo Guo(gcb)
Needs approval
ChangBo Guo(gcb)
Series goal:
Good progress
Milestone target:
Started by
Dolph Mathews
Completed by
Morgan Fainberg

Related branches



I'd love to see this completed in icehouse, but how realistic is that goal? Should this be 'ongoing' instead? Should the abandoned reviews above be restored? I also set a conservative Implementation status; please revise if you think there's a more accurate choice. -Dolph

We need Python 3 Jekins job support from CI infrastructure team , otherwise we are just fixing "KNOWN" Python 3 compatible issues, potential blockers still be there. I will try my best to make Keystone moved to Python 3 smoothly, but can't guarantee that if we can't test in Python 3. the abandoned reviews was abandoned on purpose(just removed them from the whiteboard), we decide to use six not oslo py3kcompat module. -gcb

Agree, I'd like to have a py33 gate job running and passing to consider this blueprint as Implemented. If it doesn't look like that's going to happen by the end of icehouse, we can retarget this to "ongoing" -Dolph

Gerrit topic:,topic:bp/keystone-py3kcompat,n,z

Addressed by:
    Replace urllib/urlparse with six.moves.*

Addressed by: (merged)
    Use six.string_types replace basestring

Addressed by: (merged)
    Use six.text_types replace unicode

Addressed by: (merged)
    Use six to make dict work in Python 2 and Python 3

Addressed by: (merged)
    Unify StringIO usage with six.StringIO

Addressed by: (abandoned)
    Fix urllib2 compatibility in test

Addressed by: (abandoned)
    override the range() builtin with six.moves.range

Gerrit topic:,topic:(detached,n,z

Addressed by: (merged)
    Sync oslo's policy module

Addressed by:
    Overrides filter builtin using six

Addressed by:
    Moves database setup/teardown closer to its usage

Addressed by:
    wip: this needs to be made in oslo

Addressed by:
    First real Python 3 tests

Addressed by:
    Make the py33 Jenkins job happy

Addressed by:
    Replace unicode with six.text_type

Addressed by:
    Fix py34 problems in test_middleware


Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.