classification
Title: multiprocessing docs example still refs os.getppid as unix-only
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bar.harel, berker.peksag, davin, docs@python, jftuga, python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2015-09-18 14:54 by jftuga, last changed 2015-09-21 03:16 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
multiprocessing_patch.patch bar.harel, 2015-09-18 16:59 review
Messages (6)
msg251002 - (view) Author: John Taylor (jftuga) * Date: 2015-09-18 14:54
In the Windows Help File for Python 3.5:

17.2 multiprocessing
17.2.1.1 The Process class
2nd code example: "To show the individual process IDs involved, here is an expanded example"

def info(title):
    print(title)
    print('module name:', __name__)
    if hasattr(os, 'getppid'):  # only available on Unix
        print('parent process:', os.getppid())
    print('process id:', os.getpid())

os.getppid() is now available on Windows, so you can remove the if statement.
msg251003 - (view) Author: John Taylor (jftuga) * Date: 2015-09-18 15:06
To follow up on my previous message, I looked at the documentation for os.getppid().

It states:

Changed in version 3.2: Added support for Windows.
msg251012 - (view) Author: Bar Harel (bar.harel) * Date: 2015-09-18 16:59
Here's a quick minor patch to fix, works on a re-compiled doc.
msg251179 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-09-20 22:30
Good catch and agreed this should be cleaned up.

Patch looks good to me and given its nature is probably all we need although it's probably worth combining this minor documentation update so that it gets applied with some other documentation patch(es) at the same time.
msg251193 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-21 03:13
New changeset 60b0bc23c69e by Berker Peksag in branch '3.4':
Issue #25169: os.getppid() is available on Windows since Python 3.2.
https://hg.python.org/cpython/rev/60b0bc23c69e

New changeset c6ccef432dc2 by Berker Peksag in branch '3.5':
Issue #25169: os.getppid() is available on Windows since Python 3.2.
https://hg.python.org/cpython/rev/c6ccef432dc2

New changeset 71a6d4c7cd01 by Berker Peksag in branch 'default':
Issue #25169: os.getppid() is available on Windows since Python 3.2.
https://hg.python.org/cpython/rev/71a6d4c7cd01
msg251194 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-09-21 03:16
Fixed in 3.4, 3.5 and 3.6. Thanks all!
History
Date User Action Args
2015-09-21 03:16:04berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg251194

resolution: fixed
stage: patch review -> resolved
2015-09-21 03:13:35python-devsetnosy: + python-dev
messages: + msg251193
2015-09-20 22:31:22davinsettitle: multiprocess documentation -> multiprocessing docs example still refs os.getppid as unix-only
2015-09-20 22:30:06davinsetnosy: + davin

messages: + msg251179
versions: + Python 3.4, Python 3.6
2015-09-20 20:52:45davinsettype: enhancement
stage: patch review
2015-09-19 02:10:03terry.reedysetnosy: + terry.reedy
2015-09-18 16:59:24bar.harelsetfiles: + multiprocessing_patch.patch

nosy: + bar.harel
messages: + msg251012

keywords: + patch
2015-09-18 15:06:29jftugasetmessages: + msg251003
2015-09-18 14:54:36jftugacreate