Python 3 versions

Andrew Bartlett abartlet at
Wed Mar 28 06:10:10 UTC 2018

On Wed, 2018-03-28 at 15:42 +1300, Douglas Bagnall via samba-technical
> On a Github pull request regarding Python 3 porting
> (, 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:
> 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?

I totally agree, when we lock onto a python3 baseline we need it should
be as recent as practical.  I also think we should drop Python2 as soon
as we have python3 fully working, as otherwise there will be an
insistence long-term on the py2 stuff.  (This transition has already
cost us an incredible amount of resource, staying dual-stack long-term
is just silly). 

For the immediate future, keeping with 3.4 is the most practical
option, but we need to move past that quickly.

In practical terms, we can install python 3.6 in the docker image used
for CI on gitlab and we can move travis-ci to using docker as well. 
Fixing the packer script for the image used at Catalyst is also fairly
practical.  That just leaves sn-devel, hopefully the root folks can let
us know if that is possible.

The alternative is that we get sn-devel (and the docker/cloud images)
up to 18.04, which helps us on a number of fronts.  Depending on the
root folks, that might be possible before 4.9 freezes for example.

> Joe Guo wrote:
> > % formatting for bytes is added in Python 3.5, formatting like this
> > line will cause error in Python 3.4:
> >

Yeah, we want features like this and moving to Python3 only to be
stuck at really-old-python3 would be really frustrating.

I hope this helps us find a way forward,

Andrew Bartlett

Andrew Bartlett             
Authentication Developer, Samba Team
Samba Developer, Catalyst IT

More information about the samba-technical mailing list