Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Patch] posixmodule: Make the presence of os.getpid() optional #72343

Closed
EdSchouten mannequin opened this issue Sep 14, 2016 · 3 comments
Closed

[Patch] posixmodule: Make the presence of os.getpid() optional #72343

EdSchouten mannequin opened this issue Sep 14, 2016 · 3 comments
Labels
3.7 (EOL) end of life extension-modules C modules in the Modules dir

Comments

@EdSchouten
Copy link
Mannequin

EdSchouten mannequin commented Sep 14, 2016

BPO 28156
Nosy @berkerpeksag, @EdSchouten
Files
  • patch-no-getpid: Patch to provide os.getpid() conditionally
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-09-15.17:47:11.187>
    created_at = <Date 2016-09-14.16:53:50.884>
    labels = ['extension-modules', '3.7']
    title = '[Patch] posixmodule: Make the presence of os.getpid() optional'
    updated_at = <Date 2016-09-15.17:47:11.184>
    user = 'https://github.com/EdSchouten'

    bugs.python.org fields:

    activity = <Date 2016-09-15.17:47:11.184>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-15.17:47:11.187>
    closer = 'berker.peksag'
    components = ['Extension Modules']
    creation = <Date 2016-09-14.16:53:50.884>
    creator = 'EdSchouten'
    dependencies = []
    files = ['44664']
    hgrepos = []
    issue_num = 28156
    keywords = []
    message_count = 3.0
    messages = ['276470', '276579', '276580']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'berker.peksag', 'EdSchouten']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue28156'
    versions = ['Python 3.6', 'Python 3.7']

    @EdSchouten
    Copy link
    Mannequin Author

    EdSchouten mannequin commented Sep 14, 2016

    CloudABI (https://mail.python.org/pipermail/python-dev/2016-July/145708.html) does not provide getpid(). Though this may sound quite silly at first, there is quite a good reason for this. One of the things that CloudABI wants to achieve is making large scale (cluster/cloud) computing easier. In such an environment there is rarely a need for having machine-local unique process identifiers. They have to be globally unique and preferably not recycled.

    POSIX requires that pid_t is a signed integer that must have a positive value. Most C compilers only provide full support for integers up to 64 bits in size. This means that CloudABI could only provide 63-bit process identifiers, which is far smaller than, say, a UUID. For this reason we've decided to omit getpid() altogether.

    Attached is a patch that makes use of the already existing HAVE_GETPID definition in pyconfig.h to disable the os.getpid() function that is part of the posixmodule.

    @EdSchouten EdSchouten mannequin added the extension-modules C modules in the Modules dir label Sep 14, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 15, 2016

    New changeset d17ff867580f by Berker Peksag in branch '3.6':
    Issue bpo-28156: Export os.getpid() conditionally
    https://hg.python.org/cpython/rev/d17ff867580f

    New changeset 33834105048e by Berker Peksag in branch 'default':
    Issue bpo-28156: Merge from 3.6
    https://hg.python.org/cpython/rev/33834105048e

    @berkerpeksag
    Copy link
    Member

    Thanks!

    @berkerpeksag berkerpeksag added the 3.7 (EOL) end of life label Sep 15, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant