Python 3 versions

Andreas Schneider asn at samba.org
Wed Mar 28 13:20:26 UTC 2018


On Wednesday, 28 March 2018 08:10:10 CEST Andrew Bartlett via samba-technical 
wrote:
> On Wed, 2018-03-28 at 15:42 +1300, Douglas Bagnall via samba-technical
> 
> wrote:
> > 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?
> 
> 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).

Here is an example:

RHEL7 offers python 2.7.5 and python 3.3. If you want to support enterprise 
distributions with python3 you need to go with 3.3.

If you want to go with python 3.5 you need to keep python 2.7 support around 
till those distros are out of support or drop python2 to in favor of a newer 
python3 version (unlikely).

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org





More information about the samba-technical mailing list