[PATCH] Python3 compatible tests and credentials module
pviktori at redhat.com
Fri Nov 25 16:20:13 UTC 2016
On 11/25/2016 03:40 AM, Andrew Bartlett wrote:
> On Thu, 2016-11-24 at 14:59 +0100, Lumir Balhar wrote:
>> Because I have no response for two weeks on GitHub , I decided to
>> send my patches here. Which way is preferred, please?
>> The first part of this PR contains changes necessary to run tests
>> Python 3. These changes should not have any impact on functionality
>> Python 2.
>> The second part ports the samba.credentials module to be Python 3
>> compatible, and also ports the credentials tests. The files
>> and compat.py will help us with porting and to make the future code
>> readable. The py3compat.h file is the same as proposed by Petr
>> and discussed in this thread:
>> I am submitting the two parts as one PR because, without at least
>> module prepared for Python 3, it is impossible to try running tests
>> Python 3.
>>  https://github.com/samba-team/samba/pull/68
> Thanks for the patch. The main thing I don't like is the if PY3 stuff,
> and the .args usage. I would rather we ported param and glue to
> python3 at the same time, they shouldn't be too hard.
The problem the PY3 guards are solving is that the main test module,
samba.tests, depends on most of Samba (dcerpc, param, ndr), and the main
samba module depends on param and _ldb
If porting needs to come with tests, either we need to port most of
Samba in one patchset, or the circular dependency needs to be cut somewhere.
I think the `if PY3` guards are the best solution here, but if you
disagree, sending a bigger patchset is of course possible.
As for param specifically, Python3 file objects are not directly backed
by FILE*, so the dump() methods in param are one of the tougher nuts to
crack during the porting. I think param would benefit from a separate
review, after preparations to run tests on py3 are done.
More information about the samba-technical