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] Complete bits necessary for making fcntl's file locking optional #71951

Closed
EdSchouten mannequin opened this issue Aug 14, 2016 · 2 comments
Closed

[Patch] Complete bits necessary for making fcntl's file locking optional #71951

EdSchouten mannequin opened this issue Aug 14, 2016 · 2 comments
Labels
extension-modules C modules in the Modules dir

Comments

@EdSchouten
Copy link
Mannequin

EdSchouten mannequin commented Aug 14, 2016

BPO 27764
Nosy @EdSchouten
Files
  • patch-no-flock.txt: Patch for making flock() and lockf() optional
  • 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 = None
    created_at = <Date 2016-08-14.20:41:01.914>
    labels = ['extension-modules']
    title = "[Patch] Complete bits necessary for making fcntl's file locking optional"
    updated_at = <Date 2016-08-14.20:41:01.914>
    user = 'https://github.com/EdSchouten'

    bugs.python.org fields:

    activity = <Date 2016-08-14.20:41:01.914>
    actor = 'EdSchouten'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2016-08-14.20:41:01.914>
    creator = 'EdSchouten'
    dependencies = []
    files = ['44105']
    hgrepos = []
    issue_num = 27764
    keywords = []
    message_count = 1.0
    messages = ['272692']
    nosy_count = 1.0
    nosy_names = ['EdSchouten']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue27764'
    versions = ['Python 3.6']

    @EdSchouten
    Copy link
    Mannequin Author

    EdSchouten mannequin commented Aug 14, 2016

    Python's fcntl module already provides some support for making support for file locking optional. For example, constants like F_SETFL are only defined if present. Unfortunately, the accompanying functions 'flock()' and 'lockf()' are present unconditionally.

    CloudABI, a sandboxed runtime environment for UNIX (https://mail.python.org/pipermail/python-dev/2016-July/145708.html), doesn't implement these ways of doing file locking, for the reason that these operations do not fit nicely within its process model. These locks are per-process; not per-descriptor. This means that processes cannot safely be composed or decomposed.

    Attached is a relatively small patch to make flock() and lockf() optional, only compiling them when the necessary APIs are present. The LOCK_* constants are now also defined optionally.

    @EdSchouten EdSchouten mannequin added the extension-modules C modules in the Modules dir label Aug 14, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @benjaminp
    Copy link
    Contributor

    CloudABI is no more.

    @benjaminp benjaminp closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant