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

STINNER Victor report at bugs.python.org
Thu May 16 23:23:58 CEST 2013


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 == SIZEOF_LONG_LONG
#define _Py_PARSE_PID "L"
#define PyLong_FromPid PyLong_FromLongLong
#define PyLong_AsPid PyLong_AsLongLong

I suppose that this path was never tested before.

Here is a new patch removing the check from pyport.h, longobject.h already fails if SIZEOF_PID_T value is not supported:

#else
#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
#endif /* SIZEOF_PID_T */

----------
Added file: http://bugs.python.org/file30289/win_sizeof_pid_t-2.patch

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


More information about the Python-bugs-list mailing list