Issue 23105: os.O_SHLOCK and os.O_EXLOCK are not available on Linux (original) (raw)

Created on 2014-12-23 14:38 by deleted250130, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue23105.diff matrixise,2016-08-06 12:38 review
Messages (12)
msg233048 - (view) Author: (deleted250130) Date: 2014-12-23 14:38
From the documentation: " os.O_DSYNC os.O_RSYNC os.O_SYNC os.O_NDELAY os.O_NONBLOCK os.O_NOCTTY os.O_SHLOCK os.O_EXLOCK os.O_CLOEXEC These constants are only available on Unix. " But os.O_SHLOCK and os.O_EXLOCK are not available on my system (Linux 3.16.7-ckt1 x86_64): sworddragon@ubuntu:~$ python3 Python 3.4.2 (default, Dec 4 2014, 09:34:20) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.O_SHLOCK Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'O_SHLOCK' >>> os.O_EXLOCK Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'O_EXLOCK' >>> exit()
msg233050 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-12-23 15:39
The documentation says "Some of them are not available on all platforms. For descriptions of their availability and use, consult the open(2) manual page on Unix or the MSDN on Windows.". The important bit there being "consult the open(2) manual page on Unix" for availability. That said, since the options are grouped and labeled with per-platform availability...but with a slightly different meaning of the word platform...I think the docs could be clarified. Do you have a suggestion for rewording that sentence to make it clearer?
msg233051 - (view) Author: (deleted250130) Date: 2014-12-23 16:11
I have missed the first part of the documentation and am not sure if something needs really to be changed. But if you think so maybe comments like "These constants are only available on Unix." could be extended by the word "commonly" like "These constants are commonly only available on Unix.".
msg272090 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2016-08-06 11:04
If you read the documentation from glibc-2.24, these options are only available on BSD and not on Linux. """ The remaining operating modes are BSD extensions. They exist only on some systems. On other systems, these macros are not defined. Macro: int O_SHLOCK Acquire a shared lock on the file, as with flock. See File Locks. If O_CREAT is specified, the locking is done atomically when creating the file. You are guaranteed that no other process will get the lock on the new file first. Macro: int O_EXLOCK Acquire an exclusive lock on the file, as with flock. See File Locks. This is atomic like O_SHLOCK. """ With my fedora 24, and glibc 2.23 I don't find any reference to these macros.
msg272091 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2016-08-06 11:04
Link to the documentation of glibc: http://www.gnu.org/software/libc/manual/html_node/Open_002dtime-Flags.html
msg272093 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2016-08-06 11:19
I am working on it.
msg272097 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2016-08-06 12:38
patch for 3.6 with the comment of Sworddragon.
msg272108 - (view) Author: (deleted250130) Date: 2016-08-06 20:36
If we decide to word it this way eventually the sentence for "Windows only" needs to be updated too. Not sure about the other sentences as they sound a bit if they would guarantee what they say. Maybe somebody else knows more.
msg272112 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2016-08-07 07:32
Which sentence with "Windows only" ? Thanks
msg272136 - (view) Author: (deleted250130) Date: 2016-08-07 23:14
Maybe it sounded a bit confusing but this text was not to be meant as a direct match against the documentation.
msg273650 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2016-08-25 13:56
The existing docs have a section "These constants are GNU extensions and not present if they are not defined by the C library." There could be a corresponding section for BSD extensions to which O_EXLOCK and O_SHLOCK are moved, or the word "GNU" can removed from the existing section and these two flags moved to it. How does that sound? My preference would be for the latter.
msg275796 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-11 14:17
New changeset 5ca4c545dfe4 by Vinay Sajip in branch '2.7': Issue #23105: Updated documentation on open() flag constants. https://hg.python.org/cpython/rev/5ca4c545dfe4 New changeset f1427491a8a5 by Vinay Sajip in branch '3.5': Issue #23105: Updated documentation on open() flag constants. https://hg.python.org/cpython/rev/f1427491a8a5 New changeset 64610bcd326f by Vinay Sajip in branch 'default': Closes #23105: Merged update from 3.5. https://hg.python.org/cpython/rev/64610bcd326f
History
Date User Action Args
2022-04-11 14:58:11 admin set github: 67294
2016-09-11 14:17:07 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: patch review -> resolved
2016-08-25 13:56:15 vinay.sajip set nosy: + vinay.sajipmessages: +
2016-08-07 23:14:22 deleted250130 set messages: +
2016-08-07 07:32:49 matrixise set messages: +
2016-08-06 20:36:11 deleted250130 set messages: +
2016-08-06 12:38:25 matrixise set files: + issue23105.diffkeywords: + patchmessages: + stage: needs patch -> patch review
2016-08-06 11:19:58 matrixise set messages: +
2016-08-06 11:04:46 matrixise set messages: +
2016-08-06 11:04:25 matrixise set nosy: + matrixisemessages: +
2016-08-06 10:41:35 berker.peksag set keywords: + easystage: needs patchversions: + Python 3.6, - Python 3.4
2014-12-23 16:11:22 deleted250130 set messages: +
2014-12-23 15:39:44 r.david.murray set versions: + Python 2.7, Python 3.5nosy: + r.david.murray, docs@pythonmessages: + assignee: docs@pythoncomponents: + Documentation, - Library (Lib)
2014-12-23 14:39:27 deleted250130 set components: + Library (Lib)
2014-12-23 14:39:17 deleted250130 set type: behavior
2014-12-23 14:38:55 deleted250130 create