pytevent improvements & Python 3 port

Jelmer Vernooij jelmer at samba.org
Thu Jun 4 06:29:34 MDT 2015


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?

Cheers,

Jelmer


More information about the samba-technical mailing list