From 2a1b33df9f516a4f2f4051423cdefd0c3b80d489 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 12 Jul 2022 12:19:41 -0700 Subject: [PATCH] os: Params for posix_fallocate and posix_fadvise are pos-only (#8283) https://github.com/python/cpython/blob/90a6e56e5663233fe986331ef3f10422fe57dcbc/Modules/posixmodule.c#L10845 --- stdlib/os/__init__.pyi | 4 ++-- tests/stubtest_allowlists/linux-py310.txt | 2 -- tests/stubtest_allowlists/linux-py311.txt | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 7500ba0e7..8dc209f0e 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -616,8 +616,8 @@ if sys.platform != "win32": if sys.platform != "darwin": def fdatasync(fd: FileDescriptorLike) -> None: ... def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix - def posix_fallocate(fd: int, offset: int, length: int) -> None: ... - def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... + def posix_fallocate(__fd: int, __offset: int, __length: int) -> None: ... + def posix_fadvise(__fd: int, __offset: int, __length: int, __advice: int) -> None: ... def pread(__fd: int, __length: int, __offset: int) -> bytes: ... def pwrite(__fd: int, __buffer: bytes, __offset: int) -> int: ... diff --git a/tests/stubtest_allowlists/linux-py310.txt b/tests/stubtest_allowlists/linux-py310.txt index 489baa748..5030f3fd6 100644 --- a/tests/stubtest_allowlists/linux-py310.txt +++ b/tests/stubtest_allowlists/linux-py310.txt @@ -5,8 +5,6 @@ _?curses.color_pair (os|posix).SPLICE_F_MORE (os|posix).SPLICE_F_MOVE (os|posix).SPLICE_F_NONBLOCK -(os|posix).posix_fadvise -(os|posix).posix_fallocate (os|posix).sched_getaffinity (os|posix).sched_getparam (os|posix).sched_getscheduler diff --git a/tests/stubtest_allowlists/linux-py311.txt b/tests/stubtest_allowlists/linux-py311.txt index 874f19a20..53283c085 100644 --- a/tests/stubtest_allowlists/linux-py311.txt +++ b/tests/stubtest_allowlists/linux-py311.txt @@ -7,8 +7,6 @@ mmap.MAP_STACK (os|posix).SPLICE_F_MORE (os|posix).SPLICE_F_MOVE (os|posix).SPLICE_F_NONBLOCK -(os|posix).posix_fadvise -(os|posix).posix_fallocate (os|posix).sched_getaffinity (os|posix).sched_getparam (os|posix).sched_getscheduler