Python 3 versions

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Wed Mar 28 02:42:32 UTC 2018


On a Github pull request regarding Python 3 porting
(https://github.com/samba-team/samba/pull/152), Joe Guo pointed out
that the following construct

>          :return: list with key names
>          """
> -        data = self.db.get("%s\x00" % key)
> +        data = self.db.get(b"%s\x00" % key)
>          if data is None:
>              return []

uses printf style formatting on a bytes object, which is supported in
Python 3.5 (and 2.[67]) but not Python 3.4. Our autobuild box runs
Ubuntu 14.04 with Python 3.4, so we currently can't do this.

This is not difficult to work around, but it is one more thing that
makes me yearn to skip 3.4 and just go to 3.5 or 3.6, before anyone
actually relies on Python 3. For example, the async/await syntax looks
useful, at least for testing:

https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax

But if we allow a 3.4-reliant release to get on an 3.4-reliant
enterprise distro, we won't be able to use this for, you know,
decades.

So I am asking: is a 3.5 minimum remotely possible? Are there going to
be long-lived enterprise releases that have Python 3.4? Can we upgrade
sn-devel and forget 3.4 existed?

I guess there is another tricky question around supporting e.g.
RHEL/Centos 7, where Python 2.7 is king but a 3.x is available. How
quickly can we drop 2.7 support and push Samba on those machines to
3.x?

Joe Guo wrote:

> % formatting for bytes is added in Python 3.5, formatting like this
> line will cause error in Python 3.4:
> https://www.python.org/dev/peps/pep-0461/

Douglas



More information about the samba-technical mailing list