[issue6394] getppid support in os module on Windows

2010-09-07 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue6394] getppid support in os module on Windows

2010-09-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Committed r84601. Thanks for the patch and your perseverance! -- ___ Python tracker ___ ___ Py

[issue6394] getppid support in os module on Windows

2010-09-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 subprocess instead of mul

[issue6394] getppid support in os module on Windows

2010-09-07 Thread Jon Anglin
Jon Anglin 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 happen. -- Added file

[issue6394] getppid support in os module on Windows

2010-09-07 Thread Jon Anglin
Jon Anglin 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 ___ Python tracker

[issue6394] getppid support in os module on Windows

2010-09-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +brian.curtin, tim.golden stage: -> patch review versions: +Python 3.2 -Python 2.7 ___ Python tracker ___ ___

[issue6394] getppid support in os module on Windows

2009-07-02 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 close and restart

[issue6394] getppid support in os module on Windows

2009-07-02 Thread Jon Anglin
Jon Anglin 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 not rely on the value of i

[issue6394] getppid support in os module on Windows

2009-07-02 Thread Jon Anglin
Jon Anglin added the comment: I have addressed the issues brought up by Amaury Forgeot d'Arc except for the unit test. I will get a unit test in tommorrow. Thank you for the feedback. I have uploaded a new diff file Issue6394-2.diff. - Should I remove the old diff files? I ran some test w

[issue6394] getppid support in os module on Windows

2009-07-02 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 win32_error(...)" is c

[issue6394] getppid support in os module on Windows

2009-07-01 Thread Jon Anglin
Jon Anglin 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 error it raises a WindowsErr

[issue6394] getppid support in os module on Windows

2009-07-01 Thread Antoine Pitrou
Antoine Pitrou 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 ___ Python tr

[issue6394] getppid support in os module on Windows

2009-07-01 Thread Jon Anglin
New submission from Jon Anglin : 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 error it will return -1.

[issue6394] getppid support in os module on Windows

2009-07-01 Thread Jon Anglin
Jon Anglin 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 me and I am learning, it w