[openstack-dev] Sprint at Pycon: Port OpenStack to Python 3

Doug Hellmann doug.hellmann at dreamhost.com
Tue Apr 1 14:34:03 UTC 2014


On Tue, Apr 1, 2014 at 9:44 AM, John Dennis <jdennis at redhat.com> wrote:
> On 04/01/2014 04:40 AM, victor stinner wrote:
>> Hi,
>>
>> I will organize a sprint to Port OpenStack to Python 3 during 4 days
>> at Montreal (Canada) during Pycon Montreal 2014, between April, 14
>> (Monday) and April, 17 (Thursday).
>>
>> The goal of the sprint is to port OpenStack components and OpenStack
>> dependencies to Python 3,
>
> This is a great goal, thank you! But I'm concerned it might be premature.
>
> My concern is this. The singled biggest change in Py2 -> Py3 is string
> handling, especially with regards to str vs. unicode. We have a
> significant number of bugs in the current code base with regards to
> encoding exceptions, I just got done fixing a number of them, I know
> there are others. While I was fixing them I searched the OpenStack
> coding guidelines to find out coding practices were supposed to be
> enforcing with regards to non-ASCII strings and discovered there is
> isn't much, it seems incomplete. Some of it seems based more on
> speculation than actual knowledge of defined Python behavior. I'm not
> sure, but given we do not have clear guidelines for unicode in Py2,
> never mind guidelines that will allow running under both Py2 and Py3 I'm
> willing to guess we have little in the gate testing that enforces any
> string handling guidelines.
>
> I'm just in the process of finishing up a document to address these
> concerns. Unfortunately I'm going to be off-line for several weeks and I
> didn't want to start a discussion I couldn't participate in (plus there
> are some Py3 issues in the document I need to clean up) so I was going
> to wait to post it.
>
> My concern is we need to get our Py2 house in order *before* tackling
> Py3 porting. Doing Py3 porting before we have clear guidelines on
> unicode, str, bytes, encoding, etc. along with gate tests that enforce
> these guidelines is putting the cart before the horse. Whatever patches
> come out of a Py3 porting sprint might have to be completely redone.
>
> FWIW projects that deal with web services, wire protocols, external
> datastores, etc. who have already started porting to Py3 have
> encountered significant pain points with Py3, some of which is just
> being resolved and which have caused on-going changes in Py3. We deal
> with a lot of these same issues in OpenStack. Before we just start
> hacking away I think it would behoove us to first have a very clear and
> explicit document on how we're going to address these issues *before* we
> start changing code.

It sounds like the documentation you are working on will be really
helpful for planning.

We fully expect the porting process to take time and to have multiple
phases. Having code bases that can be tested under multiple versions
of the interpreter will be a good milestone, and help us uncover
issues similar to what you've identified in some places already. My
understanding is that the work so far has been on lower-level and
client libraries where the code base is smaller and the work can be
more focused for a similar reason.

Doug



More information about the OpenStack-dev mailing list