Python 3 versions

Noel Power nopower at
Wed Mar 28 10:45:21 UTC 2018

On 28/03/18 03:42, Douglas Bagnall wrote:
> 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,
While not difficult for the simple example above, it makes the py2/py3
code even uglier and imo harder to visually inspect/maintain thus more
error prone. I'd be for making life simpler/easier and shift the goal
posts while we can. I would imagine that the issue above is not the only
one where life is easier with > python3.4
> 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?
+1 for at least min 3.5 unless there is some other case for 3.6 (I can't
tell, not python enabled enough).

> 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'd say we are unfortunately probably in for a good period of time where
py2/py3 will need to coexist. The current focus is on being able to
build for (e.g. provide build products) for py2/py3 whilst also being
able to test with both versions. This is a sensible strategy. Being able
to build from py3 (which is what Alexander was looking at) will enable
the full conversion to happen (and python2 support to be optionally
removed) and everything to build/run/deliver under py3, the good thing
is that can be done in parallel while we continue to move the build
products and tests to be py2/p3 compatible. This is why we should try
and make life as easy as possibly for ourselves by choosing a base
python3 version that suits our needs


More information about the samba-technical mailing list