[Python-Dev] os.spawnv problem

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Sun, 9 Jul 2000 15:12:04 +0200

I wrote:
> according to posixmodule.c (trent?), they return an
> intptr_t.
> unfortunately, this little change causes some inter-
> resting problems; spawnv tells me that my program
> returns the following exit code:
>     2167387144924954624
> or, in another base:
>      0x1E141B2000000000L
> unless anyone can explain what those upper bit mean,
> and why they are relevant, I suggest casting the return
> code down to an int.

nevermind; I found the problem: the preprocessor doesn't
complain if you're comparing variables that doesn't exist,
so the following code didn't quite do what the programmer
had expected:

  return Py_BuildValue("l", spawnval);
  return Py_BuildValue("L", spawnval);

(SIZE_VOID_P is not defined, and you cannot really expect
Py_BuildValue to do the right thing if spawnval is an integer).

patch coming.