pytevent improvements & Python 3 port

Petr Viktorin pviktori at redhat.com
Thu Jun 11 06:56:02 MDT 2015


On 06/10/2015 06:06 AM, Andrew Bartlett wrote:
> On Thu, 2015-06-04 at 12:29 +0000, Jelmer Vernooij wrote:
>> On Tue, Jun 02, 2015 at 03:14:39PM +0200, Petr Viktorin wrote:
>>> On 05/26/2015 02:07 PM, Petr Viktorin wrote:
>>>> Hello,
>>>>
>>>> The first patch is a fix for a bug in the buildsystem changes for py3.
>>>> (It only occurs when building for two Pythons, so Samba is safe.)
>>>>
>>>> I've played a bit with the pytevent wrapper, and found that the types
>>>> for timers and FDs are not defined, so, for example, trying to print
>>>> them out segfaults:
>>>>
>>>>     >>> import tevent
>>>>     >>> ctx = tevent.Context()
>>>>     >>> timer = ctx.add_timer(0, lambda t: None)
>>>>     >>> timer
>>>>     Segmentation fault (core dumped)
>>>>
>>>> I'm sending a quick fix for FDs, and a more comprehensive one for timers.
>>>>
>>>> Also, "Context.add_timer" requires passing a struct timeval cast to a
>>>> long inside a Python integer, which is very hard to do portably from
>>>> Python. I've added "add_timer_offset", which takes a number of seconds
>>>> from now.
>>>>
>>>> I've also ported pytevent to Python 3. The library doesn't deal with
>>>> strings much, so the port is trivial.
>>>
>>> Ping, could someone find the time to look at these patches?
>> Thanks, this looks good to me. Reviewed-By: me
>>
>> Can somebody else also review and push?
> 
> Sorry for the unacceptable delay in looking at this.
> 
> Reviewed-by: me and pushed to autobuild.
> 
> Thanks!
> 
> Andrew Bartlett
> 

Thank you both for the review!

-- 
Petr Viktorin


More information about the samba-technical mailing list