classification
Title: Python considers pid longs under 64-bit Windows
Type: behavior Stage:
Components: Extension Modules, Interpreter Core, Windows Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, brian.curtin, pitrou, tim.golden
Priority: normal Keywords:

Created on 2010-08-15 18:02 by pitrou, last changed 2010-08-26 21:22 by amaury.forgeotdarc.

Messages (2)
msg113982 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-08-15 18:02
Under 64-bit Windows, Python aliases PyLong_FromPid() to PyLong_FromLong() (and PyLong_AsPid() to PyLong_AsLong()), but a C "long" is 32-bit, while apparently the MSVCRT defines a pid to be intptr_t, that is 64-bit. A potential loss of data ensues.
msg115027 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-08-26 21:22
The spawn* functions return intptr_t, because it's the process handle.
But _getpid() returns an int.
Both seem to be correctly handled.

Which part do you suspect to truncate data?
History
Date User Action Args
2010-08-26 21:22:23amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg115027
2010-08-15 18:02:25pitroucreate