[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-06 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___ ___

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: pid_t is HANDLE on Windows, which is a pointer. I think this is wrong. The signature of getpid() is int _getpid(void); so pid_t should be equivalent to int. The complication is that the return values of spawn*() etc are process handles (cast to

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread STINNER Victor
STINNER Victor added the comment: The complication is that the return values of spawn*() etc are process handles (cast to intptr_t), not pids: I opened this issue because of a compiler warning in os.waitpid(). On Windows, the C function _cwait() is used and it expects a intptr_t (handle to

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: @sbt: Would you like to have a strict separation between UNIX-like pid (pid_t) and Windows process identifier (HANDLE)? Yes. And would I certainly like SIZEOF_PID_T == sizeof(pid_t) ;-) Note that _winapi takes the policy of treating HANDLE as an unsigned

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: I see _Py_PARSE_PID already exists but no others ... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: Attached is a patch that adds _Py_PARSE_INTPTR and _Py_PARSE_UINTPTR to Include/longobject.h. It also uses _Py_PARSE_INTPTR in Modules/posixmodule.c and PC/msvcrtmodule.c and removes the definition for SIZEOF_PID. -- Added file:

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread STINNER Victor
STINNER Victor added the comment: -/* The size of `pid_t' (HANDLE). */ -#define SIZEOF_PID_T SIZEOF_VOID_P I would prefer to have SIZEOF_PID_T defined: #define SIZEOF_PID_T SIZEOF_INT win32_kill() uses DWORD type, not pid_t. Except these nits, your patch looks good and is more correct than my

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0410bf251e10 by Richard Oudkerk in branch 'default': Issue #17931: Resolve confusion on Windows between pids and process handles. http://hg.python.org/cpython/rev/0410bf251e10 -- ___ Python tracker

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2298bcba6ec9 by Victor Stinner in branch 'default': Close #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are identified http://hg.python.org/cpython/rev/2298bcba6ec9 -- nosy: +python-dev resolution: - fixed stage: -

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-18 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___ ___

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-16 Thread STINNER Victor
STINNER Victor added the comment: @Antoine (author of the commit fixing #1983): any opinion? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sounds fine to me, but perhaps better test the patch before committing? (or wait for the buildbots to crash) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-16 Thread STINNER Victor
STINNER Victor added the comment: Oh, I just noticed the following check in pyport.h: #if SIZEOF_PID_T SIZEOF_LONG # error Python doesn't support sizeof(pid_t) sizeof(long) #endif I don't understand this test, longobject.h contains: #elif defined(SIZEOF_LONG_LONG) SIZEOF_PID_T ==

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-07 Thread STINNER Victor
New submission from STINNER Victor: The issue #1983 was not fixed on Windows: pid_t is HANDLE on Windows, which is a pointer. SIZEOF_PID_T is not defined in PC/pyconfig.h and so longobject.h takes the default implementation (use C long type): /* Issue #1983: pid_t can be longer than a C long

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___ ___ Python-bugs-list