[PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
Hello.

I ported another Python module, samba.registry, to Python 3 compatible
form (patch #1) and I improved its test coverage (patch #2).

Everything went well with Python 2.7 and 3.6 but then I found some
issues during testing the ported module with Python 2.6.6 in VM with
fresh CentOS 6 installation.
The second two patches contain fixes for Python 2.6.

The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
function PyErr_NewExceptionWithDoc is used, but this function is
available only in Python 2.7 and higher. This bug was probably hidden
because pam_wrapper can be installed as a distribution package. Fixed
with #if/#else in patch 3.

The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
get an error about undefined kill() function and SIGKILL constant. I
don't know where this bug comes from, but including signal.h header file
fixes it. Fix attached as patch 4.

Thank you and have a nice day.

Lumír


0004-unittests-Fix-missing-include-of-signal.h.patch (769 bytes) Download Attachment
0003-python-Fix-Python-2.6-compatibility.patch (1K) Download Attachment
0002-tests-Improve-tests-of-samba.registry-Python-module.patch (2K) Download Attachment
0001-python-Port-samba.registry-module-to-Python-3-compat.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
On Thursday, 12 October 2017 11:30:28 CEST Lumir Balhar via samba-technical
wrote:

> Hello.
>
> I ported another Python module, samba.registry, to Python 3 compatible
> form (patch #1) and I improved its test coverage (patch #2).
>
> Everything went well with Python 2.7 and 3.6 but then I found some
> issues during testing the ported module with Python 2.6.6 in VM with
> fresh CentOS 6 installation.
> The second two patches contain fixes for Python 2.6.
>
> The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
> function PyErr_NewExceptionWithDoc is used, but this function is
> available only in Python 2.7 and higher. This bug was probably hidden
> because pam_wrapper can be installed as a distribution package. Fixed
> with #if/#else in patch 3.

Please also create a patch against:
https://git.samba.org/?p=pam_wrapper.git;a=summary
 
> The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
> get an error about undefined kill() function and SIGKILL constant. I
> don't know where this bug comes from, but including signal.h header file
> fixes it. Fix attached as patch 4.

RB+

Second team member needed for review.


Cheers,


        Andreas


--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
On 10/12/2017 03:04 PM, Andreas Schneider wrote:

> On Thursday, 12 October 2017 11:30:28 CEST Lumir Balhar via samba-technical
> wrote:
>> Hello.
>>
>> I ported another Python module, samba.registry, to Python 3 compatible
>> form (patch #1) and I improved its test coverage (patch #2).
>>
>> Everything went well with Python 2.7 and 3.6 but then I found some
>> issues during testing the ported module with Python 2.6.6 in VM with
>> fresh CentOS 6 installation.
>> The second two patches contain fixes for Python 2.6.
>>
>> The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
>> function PyErr_NewExceptionWithDoc is used, but this function is
>> available only in Python 2.7 and higher. This bug was probably hidden
>> because pam_wrapper can be installed as a distribution package. Fixed
>> with #if/#else in patch 3.
> Please also create a patch against:
> https://git.samba.org/?p=pam_wrapper.git;a=summary
Patch for Samba can be directly applied to Pam wrapper but I created it
for pam_wrapper repo.

>  
>> The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
>> get an error about undefined kill() function and SIGKILL constant. I
>> don't know where this bug comes from, but including signal.h header file
>> fixes it. Fix attached as patch 4.
> RB+
>
> Second team member needed for review.
>
>
> Cheers,
>
>
> Andreas
>
>


0001-pypamtest-Fix-Python-2.6-compatibility.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
I found out that I need to add one more #if to supress warning about
unused PamTestError__doc__ in Python 2.6.

Sorry for the complication. I'll test it again in all Pythons and then
I'll send new patches for samba and also for pam_wrapper.

Lumír


On 10/12/2017 03:04 PM, Andreas Schneider wrote:

> On Thursday, 12 October 2017 11:30:28 CEST Lumir Balhar via samba-technical
> wrote:
>> Hello.
>>
>> I ported another Python module, samba.registry, to Python 3 compatible
>> form (patch #1) and I improved its test coverage (patch #2).
>>
>> Everything went well with Python 2.7 and 3.6 but then I found some
>> issues during testing the ported module with Python 2.6.6 in VM with
>> fresh CentOS 6 installation.
>> The second two patches contain fixes for Python 2.6.
>>
>> The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
>> function PyErr_NewExceptionWithDoc is used, but this function is
>> available only in Python 2.7 and higher. This bug was probably hidden
>> because pam_wrapper can be installed as a distribution package. Fixed
>> with #if/#else in patch 3.
> Please also create a patch against:
> https://git.samba.org/?p=pam_wrapper.git;a=summary
>  
>> The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
>> get an error about undefined kill() function and SIGKILL constant. I
>> don't know where this bug comes from, but including signal.h header file
>> fixes it. Fix attached as patch 4.
> RB+
>
> Second team member needed for review.
>
>
> Cheers,
>
>
> Andreas
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
Hello.

Here is the promised patchset where the warning about unused variable
(Python 2.6) is fixed. There is also one patch for pam_wrapper.

Thank you and have a nice day.

Lumír


On 10/12/2017 03:04 PM, Andreas Schneider wrote:

> On Thursday, 12 October 2017 11:30:28 CEST Lumir Balhar via samba-technical
> wrote:
>> Hello.
>>
>> I ported another Python module, samba.registry, to Python 3 compatible
>> form (patch #1) and I improved its test coverage (patch #2).
>>
>> Everything went well with Python 2.7 and 3.6 but then I found some
>> issues during testing the ported module with Python 2.6.6 in VM with
>> fresh CentOS 6 installation.
>> The second two patches contain fixes for Python 2.6.
>>
>> The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
>> function PyErr_NewExceptionWithDoc is used, but this function is
>> available only in Python 2.7 and higher. This bug was probably hidden
>> because pam_wrapper can be installed as a distribution package. Fixed
>> with #if/#else in patch 3.
> Please also create a patch against:
> https://git.samba.org/?p=pam_wrapper.git;a=summary
>  
>> The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
>> get an error about undefined kill() function and SIGKILL constant. I
>> don't know where this bug comes from, but including signal.h header file
>> fixes it. Fix attached as patch 4.
> RB+
>
> Second team member needed for review.
>
>
> Cheers,
>
>
> Andreas
>
>


0001-python-Port-samba.registry-module-to-Python-3-compat.patch (4K) Download Attachment
0002-tests-Improve-tests-of-samba.registry-Python-module.patch (2K) Download Attachment
0003-python-Fix-Python-2.6-compatibility.patch (1K) Download Attachment
0004-unittests-Fix-missing-include-of-signal.h.patch (769 bytes) Download Attachment
0001-pypamtest-Fix-Python-2.6-compatibility.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] samba.registry Python 3 compatible and Python 2.6 fixes

Samba - samba-technical mailing list
On Fri, 2017-10-13 at 15:40 +0200, Lumir Balhar via samba-technical
wrote:
> Hello.
>
> Here is the promised patchset where the warning about unused variable
> (Python 2.6) is fixed. There is also one patch for pam_wrapper.
>
> Thank you and have a nice day.
>
> Lumír

This looks good.  

Reviewed-by: Andrew Bartlett <[hidden email]>

Andreas: Can you re-review the modified patches and push?

Thanks!

Andrew Bartlett

>
> On 10/12/2017 03:04 PM, Andreas Schneider wrote:
> > On Thursday, 12 October 2017 11:30:28 CEST Lumir Balhar via samba-technical
> > wrote:
> > > Hello.
> > >
> > > I ported another Python module, samba.registry, to Python 3 compatible
> > > form (patch #1) and I improved its test coverage (patch #2).
> > >
> > > Everything went well with Python 2.7 and 3.6 but then I found some
> > > issues during testing the ported module with Python 2.6.6 in VM with
> > > fresh CentOS 6 installation.
> > > The second two patches contain fixes for Python 2.6.
> > >
> > > The first problem I found is in lib/pam_wrapper/python/pypamtest.c where
> > > function PyErr_NewExceptionWithDoc is used, but this function is
> > > available only in Python 2.7 and higher. This bug was probably hidden
> > > because pam_wrapper can be installed as a distribution package. Fixed
> > > with #if/#else in patch 3.
> >
> > Please also create a patch against:
> > https://git.samba.org/?p=pam_wrapper.git;a=summary
> >  
> > > The second one is in testsuite/unittests/rpc_test_dummy_module.c where I
> > > get an error about undefined kill() function and SIGKILL constant. I
> > > don't know where this bug comes from, but including signal.h header file
> > > fixes it. Fix attached as patch 4.
> >
> > RB+
> >
> > Second team member needed for review.
> >
> >
> > Cheers,
> >
> >
> > Andreas
> >
> >
>
>
--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba