pcp
[Top] [All Lists]

Re: [pcp] qa/859 and python problem in fetchgroup wrapper?

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: [pcp] qa/859 and python problem in fetchgroup wrapper?
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Wed, 16 Mar 2016 19:00:44 -0400 (EDT)
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <56E9E306.9070108@xxxxxxxxxxxxxxxx>
References: <56E9CD24.4050501@xxxxxxxxxxxxxxxx> <9566995.32026348.1458166426505.JavaMail.zimbra@xxxxxxxxxx> <56E9E306.9070108@xxxxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: g3zGu0wSYi+Vb+R+UQfjS30CFj0Q2g==
Thread-topic: qa/859 and python problem in fetchgroup wrapper?

----- Original Message -----
> [...]
> Yep ... tv_usec here is of type suseconds_t ...
> 
> /usr/include/sys/_types.h:typedef __int32_t   __darwin_suseconds_t;   /* [???]
> microseconds */
> /usr/include/sys/time.h:typedef __darwin_suseconds_t  suseconds_t;
> 
> Is there an "approved" way of dealing with this in Python wrapper code?
> [...]

Nothing clean - have a look at pmUnits which deals with HAVE_BITFIELDS_LTOR.
We could add a symbol like HAVE_32BIT_USEC (or some better name) and expose
that in python-land, then hook it up via the c_api like pmUnits does.  Would
need it to come all the way from configure.ac I guess.

> sure looks like a bug ... but I don't think that's anywhere near the place my
> test is blowing up.
> 

Yeah, I've written a little test exposing it and exercising the fix - it does
indeed look unrelated, you'd have seen this stacktrace ...

  File "/usr/lib64/python3.4/site-packages/pcp/pmapi.py", line 236, in __init__
    self.tv_nsec = usec
  NameError: name 'usec' is not defined


cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>