[issue11750] Mutualize win32 functions

sbt report at bugs.python.org
Fri Apr 13 13:05:02 CEST 2012


sbt <shibturn at gmail.com> added the comment:

I think there are some issues with the treatment of the DWORD type.  (DWORD is a typedef for unsigned long.)

_subprocess always treats them as signed, whereas _multiprocessing treats them (correctly) as unsigned.  _windows does a mixture: functions from _subprocess parse DWORD arguments as signed ("i"), functions from _multiprocessing parse DWORD arguments as unsigned ("k"), and the constants are signed.

So in _windows the constants GENERIC_READ, NMPWAIT_WAIT_FOREVER and INFINITE will be negative.  I think this will potentially cause errors from PyArg_ParseTuple() when used as arguments to functions from _multiprocessing.

I think it is also rather confusing that some functions (eg CreatePipe()) return handles using a wrapper type which closes on garbage collection, while others (eg CreateNamedPipe()) return handles as plain integers.

(The code also needs updating because quite a few functions have since been added to _multiprocessing.win32.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11750>
_______________________________________


More information about the Python-bugs-list mailing list