New submission from Ed Schouten:

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.

----------
components: Extension Modules
files: patch-no-flock.txt
messages: 272692
nosy: EdSchouten
priority: normal
severity: normal
status: open
title: [Patch] Complete bits necessary for making fcntl's file locking optional
versions: Python 3.6
Added file: http://bugs.python.org/file44105/patch-no-flock.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27764>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to