Jon Anglin jang...@fortresgrand.com added the comment:
Here is a unit test for os.getppid on Windows. The test_os.diff file is the
diff of the Lib/test/test.os.py file from the py3k svn branch.
--
Added file: http://bugs.python.org/file18784/test_os.diff
Jon Anglin jang...@fortresgrand.com added the comment:
I have uploaded a new diff file (from the py3k svn trunk) that has all of the
changes in Doc/library/os.rst, Modules/posixmodule.c, and Lib/test/test_os.py.
It is called 6394.diff. Let me know if I can do anything else to make this
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
I'm currently working on it. I'll certainly commit it shortly with a few
changes:
- no need to say that a function fails with WindowsError, at least in the
docstring.
- return error sooner to reduce indentation.
- in tests, use
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Committed r84601. Thanks for the patch and your perseverance!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6394
___
Changes by Amaury Forgeot d'Arc amaur...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6394
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +brian.curtin, tim.golden
stage: - patch review
versions: +Python 3.2 -Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6394
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
First, I checked that the API does exist on Window 2000. And python does
not have any never fail guarantee, specially in low memory conditions.
Then, some remarks:
- If Process32First or Process32Next fail for any reason, return
Jon Anglin jang...@fortresgrand.com added the comment:
Just some information, on Windows:
- process ids are re-used.
- parent process id is set at process creation time and never updated.
(Windows Internal 4th Ed. by Russinovich and Solomon).
Thus, I would say that a long running process can
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Do these same issues exist on Unix systems?
No. When the parent exits, the child process is attached to the 'init'
process and getppid() returns 1.
And collisions are not rare at all. Actually it seems that you get the
same pid if you
Jon Anglin jang...@fortresgrand.com added the comment:
I didn't raise an exception because the Unix version never fails (or raises) so
I thought to maintain compatibility I would always return a value. Do you
advise that I should change it?
As for the tabs... This entire process is new to
New submission from Jon Anglin jang...@fortresgrand.com:
Implements getppid in the os module on Windows systems. The getppid
function was only available on Unix like systems, this diff patch brings
this functionality to Windows systems. This function will return the
parent process Id, upon
Antoine Pitrou pit...@free.fr added the comment:
I'm not qualified to comment on Windows-specific code, but two things:
- you should raise an appropriate exception on failure, not return -1
- the file is intended with tabs, not spaces
--
nosy: +pitrou
Jon Anglin jang...@fortresgrand.com added the comment:
Implements getppid in the os module on Windows systems. The getppid
function was only available on Unix like systems, this diff patch brings
this functionality to Windows systems. This function will return the
parent process Id, upon
13 matches
Mail list logo