pytevent improvements & Python 3 port
Jeremy Allison
jra at samba.org
Tue Jun 2 09:33:58 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?
I usually prioritise external contributor reviews, but unfortunately
I only know enough python to use it as a replacement for M$ in autoconf (*).
Can I get a python-using Team reviewer please ?
(*) I realize this is a criminal offence, for which I should be
prosecuted, but what can you do ? :-).
More information about the samba-technical
mailing list