Skip to content

Commit 5cd8912

Browse files
authored
Add missing fcntl constants. (#12409)
1 parent f370767 commit 5cd8912

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

stdlib/@tests/stubtest_allowlists/darwin-py311.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ webbrowser.MacOSX.__init__
1313
spwd
1414
msilib(.[a-z]+)?
1515
ossaudiodev
16+
17+
# Not present on all MacOS versions
18+
fcntl.F_OFD_GETLK
19+
fcntl.F_OFD_SETLK
20+
fcntl.F_OFD_SETLKW

stdlib/@tests/stubtest_allowlists/darwin-py312.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ curses.window.get_wch
1818
spwd
1919
msilib(.[a-z]+)?
2020
ossaudiodev
21+
22+
# Not present on all MacOS versions
23+
fcntl.F_OFD_GETLK
24+
fcntl.F_OFD_SETLK
25+
fcntl.F_OFD_SETLKW

stdlib/@tests/stubtest_allowlists/darwin-py313.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
# new in py313
2-
fcntl.F_GETNOSIGPIPE
3-
fcntl.F_OFD_GETLK
4-
fcntl.F_OFD_SETLK
5-
fcntl.F_OFD_SETLKW
6-
fcntl.F_RDAHEAD
7-
fcntl.F_SETNOSIGPIPE
82
posixpath.splitroot
93

104
# Exists locally on MacOS but not on GitHub

stdlib/fcntl.pyi

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ if sys.platform != "win32":
4444
F_SEAL_SHRINK: int
4545
F_SEAL_WRITE: int
4646
if sys.version_info >= (3, 9):
47-
F_OFD_GETLK: int
48-
F_OFD_SETLK: int
49-
F_OFD_SETLKW: int
47+
F_OFD_GETLK: Final[int]
48+
F_OFD_SETLK: Final[int]
49+
F_OFD_SETLKW: Final[int]
50+
5051
if sys.version_info >= (3, 10):
5152
F_GETPIPE_SZ: int
5253
F_SETPIPE_SZ: int
@@ -123,6 +124,18 @@ if sys.platform != "win32":
123124
RWH_WRITE_LIFE_LONG: Final = 4
124125
RWH_WRITE_LIFE_EXTREME: Final = 5
125126

127+
if sys.version_info >= (3, 11) and sys.platform == "darwin":
128+
F_OFD_SETLK: Final = 90
129+
F_OFD_SETLKW: Final = 91
130+
F_OFD_GETLK: Final = 92
131+
132+
if sys.version_info >= (3, 13) and sys.platform != "linux":
133+
# OSx and NetBSD
134+
F_GETNOSIGPIPE: Final[int]
135+
F_SETNOSIGPIPE: Final[int]
136+
# OSx and FreeBSD
137+
F_RDAHEAD: Final[int]
138+
126139
@overload
127140
def fcntl(fd: FileDescriptorLike, cmd: int, arg: int = 0, /) -> int: ...
128141
@overload

0 commit comments

Comments
 (0)