This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients serhiy.storchaka, tim.golden, vstinner
Date 2013-05-07.22:11:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za>
In-reply-to
Content
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 on some systems */
#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
#define _Py_PARSE_PID "i"
#define PyLong_FromPid PyLong_FromLong
#define PyLong_AsPid PyLong_AsLong
#elif SIZEOF_PID_T == SIZEOF_LONG
...

The consequence is a compiler warning:

..\Modules\posixmodule.c(6603): warning C4244: 'function' : conversion from 'Py_intptr_t' to 'long', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\pythoncore.vcxproj]

It would be safer to define SIZEOF_PID_T on Windows:

#define SIZEOF_PID_T SIZEOF_VOID_P

I didn't test attached patch on Windows.

Python 3.2 is affected, but I don't think that the issue is important enough to touch this branch (which now only accept security fixes).

See also issue #17870.
History
Date User Action Args
2013-05-07 22:11:49vstinnersetrecipients: + vstinner, tim.golden, serhiy.storchaka
2013-05-07 22:11:49vstinnersetmessageid: <1367964709.89.0.899001899577.issue17931@psf.upfronthosting.co.za>
2013-05-07 22:11:49vstinnerlinkissue17931 messages
2013-05-07 22:11:49vstinnercreate