[ovs-dev] [PATCH] windows, python: Fix event type returned from poller
Alin Balutoiu
abalutoiu at cloudbasesolutions.com
Wed Aug 23 10:27:04 UTC 2017
I also think that using ctypes instead of pypiwin32 would be a good idea.
In this way we remove all the confusion caused by the implementation of wrappers
from pypiwin32 and remove the dependency on the pypiwin32 module.
Example for WaitForMultipleObjects where the wrapper from pypiwin32 raises
an exception if the function returns WAIT_FAILED and returns the error code otherwise:
https://github.com/pywin32/pypiwin32/blob/master/win32/src/win32event.i#L340-L343
For ReadFile, if we pass an overlapped structure and the ReadFile finished syncronously
we will have to make an extra call to GetOverlappedResult to get the read number of bytes.
This is due to the fact that the number of bytes read is not returned by the wrapper implementation
from pypiwin32 and the buffer is not resized if an overlapped structure is passed.
The implementation can be viewed here:
https://github.com/pywin32/pypiwin32/blob/master/win32/src/win32file.i#L896-L987
> -----Original Message-----
> From: aserdean at ovn.org [mailto:aserdean at ovn.org]
> Sent: Wednesday, August 23, 2017 12:05 PM
> To: 'Russell Bryant' <russell at ovn.org>; Alin Balutoiu
> <abalutoiu at cloudbasesolutions.com>
> Cc: dev at openvswitch.org
> Subject: RE: [ovs-dev] [PATCH] windows, python: Fix event type returned
> from poller
>
> Does it make sense to use python ctypes instead of pypiwin32?
>
> It seems better to make our own calls instead of using wrappers which treat
> just certain cases.
>
> Acked-by: Alin Gabriel Serdean <aserdean at ovn.org>
>
> > -----Original Message-----
> > From: ovs-dev-bounces at openvswitch.org [mailto:ovs-dev-
> > bounces at openvswitch.org] On Behalf Of Russell Bryant
> > Sent: Tuesday, August 22, 2017 6:34 PM
> > To: Alin Balutoiu <abalutoiu at cloudbasesolutions.com>
> > Cc: dev at openvswitch.org
> > Subject: Re: [ovs-dev] [PATCH] windows, python: Fix event type
> > returned from poller
> >
> > Ah, that makes sense for the Python version.
> >
> > The Python docs were sparse, so I wasn't sure.
> >
> > On Tue, Aug 22, 2017 at 8:35 AM, Alin Balutoiu
> > <abalutoiu at cloudbasesolutions.com> wrote:
> > > Looking at the implementation of WaitForMultipleObjects in Python it
> > > looks that the call will raise an exception if WAIT_FAILED is
> > > returned. This case is treated by the try/except block around the
> > WaitForMultipleObjects function.
> > >
> > > Thanks,
> > > Alin Balutoiu.
> > >
More information about the dev
mailing list