Skip to content

Commit abfd1c8

Browse files
committed
Update Python 3.15 stubtest allowlists
1 parent 536aeeb commit abfd1c8

10 files changed

Lines changed: 180 additions & 78 deletions

File tree

stdlib/@tests/stubtest_allowlists/linux-py315.txt

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,11 @@
1-
# ============================================
2-
# TODO: Allowlist entries that should be fixed
3-
# ============================================
1+
# =============================================================
2+
# Allowlist entries that cannot or should not be fixed; >= 3.15
3+
# =============================================================
44

55
# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
66
# decimal falls back to _pydecimal with different runtime signatures.
7-
decimal\..*
87
_decimal
9-
os.AT_NO_AUTOMOUNT
10-
os.AT_STATX_DONT_SYNC
11-
os.AT_STATX_FORCE_SYNC
12-
os.AT_STATX_SYNC_AS_STAT
13-
os.STATX_ATIME
14-
os.STATX_BASIC_STATS
15-
os.STATX_BLOCKS
16-
os.STATX_BTIME
17-
os.STATX_CTIME
18-
os.STATX_DIOALIGN
19-
os.STATX_GID
20-
os.STATX_INO
21-
os.STATX_MNT_ID
22-
os.STATX_MNT_ID_UNIQUE
23-
os.STATX_MODE
24-
os.STATX_MTIME
25-
os.STATX_NLINK
26-
os.STATX_SIZE
27-
os.STATX_TYPE
28-
os.STATX_UID
29-
os.__all__
30-
os._clearenv
31-
os.statx
32-
os.statx_result
33-
posix.AT_NO_AUTOMOUNT
34-
posix.AT_STATX_DONT_SYNC
35-
posix.AT_STATX_FORCE_SYNC
36-
posix.AT_STATX_SYNC_AS_STAT
37-
posix.STATX_ATIME
38-
posix.STATX_BASIC_STATS
39-
posix.STATX_BLOCKS
40-
posix.STATX_BTIME
41-
posix.STATX_CTIME
42-
posix.STATX_DIOALIGN
43-
posix.STATX_GID
44-
posix.STATX_INO
45-
posix.STATX_MNT_ID
46-
posix.STATX_MNT_ID_UNIQUE
47-
posix.STATX_MODE
48-
posix.STATX_MTIME
49-
posix.STATX_NLINK
50-
posix.STATX_SIZE
51-
posix.STATX_TYPE
52-
posix.STATX_UID
53-
posix.statx
54-
55-
56-
# =============================================================
57-
# Allowlist entries that cannot or should not be fixed; >= 3.15
58-
# =============================================================
8+
decimal\..*
599

6010
# Depends on how readline was built.
6111
readline.get_pre_input_hook

stdlib/@tests/stubtest_allowlists/py315.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ _struct.pack_into
1818
_thread.RLock.__exit__
1919
_thread.lock.__exit__
2020
copy.deepcopy
21-
dataclasses._MISSING_TYPE
2221
dataclasses.MISSING
22+
dataclasses._MISSING_TYPE
2323
dataclasses.field
2424
doctest.DocTestRunner.report_skip
25-
enum.__all__
2625
importlib._abc.Loader.load_module
2726
importlib._bootstrap_external.NamespacePath
2827
importlib.abc.InspectLoader.source_to_code
@@ -37,9 +36,6 @@ threading.Condition.locked
3736
tkinter.Image.__iter__
3837
tkinter.Misc.__iter__
3938
tkinter.font.Font.__iter__
40-
tkinter.simpledialog.__all__
41-
typing_extensions.__all__
42-
xml.etree.ElementTree.__all__
4339

4440
# =============================================================
4541
# Allowlist entries that cannot or should not be fixed; >= 3.15
@@ -50,6 +46,9 @@ base64.b64decode
5046
urllib.parse.urlunparse
5147
urllib.parse.urlunsplit
5248

49+
# Runtime __all__ includes no_type_check_decorator, but the attribute does not exist on Python 3.15.
50+
typing_extensions.__all__
51+
5352
# Internal implementation details of the sampling profiler.
5453
profiling.sampling.binary_collector
5554
profiling.sampling.binary_reader

stdlib/@tests/stubtest_allowlists/win32-py315.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# ============================================
2-
# TODO: Allowlist entries that should be fixed
3-
# ============================================
4-
5-
_winapi.DeregisterEventSource
6-
_winapi.EVENTLOG_AUDIT_FAILURE
7-
_winapi.EVENTLOG_AUDIT_SUCCESS
8-
_winapi.EVENTLOG_ERROR_TYPE
9-
_winapi.EVENTLOG_INFORMATION_TYPE
10-
_winapi.EVENTLOG_SUCCESS
11-
_winapi.EVENTLOG_WARNING_TYPE
12-
_winapi.GetOEMCP
13-
_winapi.RegisterEventSource
14-
_winapi.ReportEvent
15-
winreg.DeleteTree
16-
17-
181
# =============================================================
192
# Allowlist entries that cannot or should not be fixed; >= 3.15
203
# =============================================================

stdlib/_winapi.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ if sys.platform == "win32":
2929
ERROR_PIPE_CONNECTED: Final = 535
3030
ERROR_SEM_TIMEOUT: Final = 121
3131

32+
if sys.version_info >= (3, 15):
33+
EVENTLOG_AUDIT_FAILURE: Final = 16
34+
EVENTLOG_AUDIT_SUCCESS: Final = 8
35+
EVENTLOG_ERROR_TYPE: Final = 1
36+
EVENTLOG_INFORMATION_TYPE: Final = 4
37+
EVENTLOG_SUCCESS: Final = 0
38+
EVENTLOG_WARNING_TYPE: Final = 2
39+
3240
FILE_FLAG_FIRST_PIPE_INSTANCE: Final = 0x80000
3341
FILE_FLAG_OVERLAPPED: Final = 0x40000000
3442

@@ -230,6 +238,10 @@ if sys.platform == "win32":
230238
) -> int: ...
231239
def ExitProcess(ExitCode: int, /) -> NoReturn: ...
232240
def GetACP() -> int: ...
241+
if sys.version_info >= (3, 15):
242+
def DeregisterEventSource(handle: int, /) -> None: ...
243+
def GetOEMCP() -> int: ...
244+
233245
def GetFileType(handle: int) -> int: ...
234246
def GetCurrentProcess() -> int: ...
235247
def GetExitCodeProcess(process: int, /) -> int: ...
@@ -243,6 +255,10 @@ if sys.platform == "win32":
243255
def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ...
244256
def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ...
245257
def LCMapStringEx(locale: str, flags: int, src: str) -> str: ...
258+
if sys.version_info >= (3, 15):
259+
def RegisterEventSource(unc_server_name: str | None, source_name: str, /) -> int: ...
260+
def ReportEvent(handle: int, type: int, category: int, event_id: int, string: str, /) -> None: ...
261+
246262
def UnmapViewOfFile(address: int, /) -> None: ...
247263
@overload
248264
def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...

stdlib/enum.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ if sys.version_info >= (3, 11):
3737

3838
if sys.version_info >= (3, 13):
3939
__all__ += ["EnumDict"]
40+
if sys.version_info >= (3, 15):
41+
__all__ += ["show_flag_values", "bin"]
4042

4143
_EnumMemberT = TypeVar("_EnumMemberT")
4244
_EnumerationT = TypeVar("_EnumerationT", bound=type[Enum])

stdlib/os/__init__.pyi

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ __all__ = [
177177
if sys.version_info >= (3, 14):
178178
# reload_environ was added to __all__ in Python 3.14.1
179179
__all__ += ["readinto", "reload_environ"]
180+
if sys.platform == "linux" and sys.version_info >= (3, 15):
181+
__all__ += ["_clearenv"]
180182
if sys.platform == "darwin" and sys.version_info >= (3, 12):
181183
__all__ += ["PRIO_DARWIN_BG", "PRIO_DARWIN_NONUI", "PRIO_DARWIN_PROCESS", "PRIO_DARWIN_THREAD"]
182184
if sys.platform == "darwin":
@@ -227,6 +229,31 @@ if sys.platform == "linux":
227229
]
228230
if sys.platform == "linux" and sys.version_info >= (3, 14):
229231
__all__ += ["SCHED_DEADLINE", "SCHED_NORMAL"]
232+
if sys.platform == "linux" and sys.version_info >= (3, 15):
233+
__all__ += [
234+
"AT_NO_AUTOMOUNT",
235+
"AT_STATX_DONT_SYNC",
236+
"AT_STATX_FORCE_SYNC",
237+
"AT_STATX_SYNC_AS_STAT",
238+
"STATX_ATIME",
239+
"STATX_BASIC_STATS",
240+
"STATX_BLOCKS",
241+
"STATX_BTIME",
242+
"STATX_CTIME",
243+
"STATX_DIOALIGN",
244+
"STATX_GID",
245+
"STATX_INO",
246+
"STATX_MNT_ID",
247+
"STATX_MNT_ID_UNIQUE",
248+
"STATX_MODE",
249+
"STATX_MTIME",
250+
"STATX_NLINK",
251+
"STATX_SIZE",
252+
"STATX_TYPE",
253+
"STATX_UID",
254+
"statx",
255+
"statx_result",
256+
]
230257
if sys.platform == "linux" and sys.version_info >= (3, 13):
231258
__all__ += [
232259
"POSIX_SPAWN_CLOSEFROM",
@@ -672,6 +699,28 @@ if sys.platform == "darwin":
672699
if sys.platform != "win32" and sys.version_info >= (3, 15):
673700
NODEV: Final[int]
674701

702+
if sys.platform == "linux" and sys.version_info >= (3, 15):
703+
AT_NO_AUTOMOUNT: Final[int]
704+
AT_STATX_DONT_SYNC: Final[int]
705+
AT_STATX_FORCE_SYNC: Final[int]
706+
AT_STATX_SYNC_AS_STAT: Final[int]
707+
STATX_ATIME: Final[int]
708+
STATX_BASIC_STATS: Final[int]
709+
STATX_BLOCKS: Final[int]
710+
STATX_BTIME: Final[int]
711+
STATX_CTIME: Final[int]
712+
STATX_DIOALIGN: Final[int]
713+
STATX_GID: Final[int]
714+
STATX_INO: Final[int]
715+
STATX_MNT_ID: Final[int]
716+
STATX_MNT_ID_UNIQUE: Final[int]
717+
STATX_MODE: Final[int]
718+
STATX_MTIME: Final[int]
719+
STATX_NLINK: Final[int]
720+
STATX_SIZE: Final[int]
721+
STATX_TYPE: Final[int]
722+
STATX_UID: Final[int]
723+
675724
if sys.platform != "win32":
676725
O_FSYNC: Final[int]
677726

@@ -755,6 +804,9 @@ if sys.platform != "win32":
755804
if sys.version_info >= (3, 14):
756805
def reload_environ() -> None: ...
757806

807+
if sys.platform == "linux" and sys.version_info >= (3, 15):
808+
def _clearenv() -> None: ...
809+
758810
if sys.version_info >= (3, 11) or sys.platform != "win32":
759811
EX_OK: Final[int]
760812

@@ -1282,6 +1334,70 @@ def stat(path: FileDescriptorOrPath, *, dir_fd: int | None = None, follow_symlin
12821334
if sys.platform != "win32":
12831335
def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only
12841336

1337+
if sys.platform == "linux" and sys.version_info >= (3, 15):
1338+
@final
1339+
class statx_result:
1340+
@property
1341+
def stx_mask(self) -> int: ...
1342+
@property
1343+
def stx_blksize(self) -> int: ...
1344+
@property
1345+
def stx_attributes(self) -> int: ...
1346+
@property
1347+
def stx_attributes_mask(self) -> int: ...
1348+
@property
1349+
def stx_rdev_major(self) -> int: ...
1350+
@property
1351+
def stx_rdev_minor(self) -> int: ...
1352+
@property
1353+
def stx_rdev(self) -> int: ...
1354+
@property
1355+
def stx_dev_major(self) -> int: ...
1356+
@property
1357+
def stx_dev_minor(self) -> int: ...
1358+
@property
1359+
def stx_dev(self) -> int: ...
1360+
@property
1361+
def stx_mode(self) -> int | None: ...
1362+
@property
1363+
def stx_nlink(self) -> int | None: ...
1364+
@property
1365+
def stx_uid(self) -> int | None: ...
1366+
@property
1367+
def stx_gid(self) -> int | None: ...
1368+
@property
1369+
def stx_ino(self) -> int | None: ...
1370+
@property
1371+
def stx_size(self) -> int | None: ...
1372+
@property
1373+
def stx_blocks(self) -> int | None: ...
1374+
@property
1375+
def stx_atime(self) -> float | None: ...
1376+
@property
1377+
def stx_atime_ns(self) -> int | None: ...
1378+
@property
1379+
def stx_btime(self) -> float | None: ...
1380+
@property
1381+
def stx_btime_ns(self) -> int | None: ...
1382+
@property
1383+
def stx_ctime(self) -> float | None: ...
1384+
@property
1385+
def stx_ctime_ns(self) -> int | None: ...
1386+
@property
1387+
def stx_mtime(self) -> float | None: ...
1388+
@property
1389+
def stx_mtime_ns(self) -> int | None: ...
1390+
@property
1391+
def stx_mnt_id(self) -> int | None: ...
1392+
@property
1393+
def stx_dio_mem_align(self) -> int | None: ...
1394+
@property
1395+
def stx_dio_offset_align(self) -> int | None: ...
1396+
1397+
def statx(
1398+
path: FileDescriptorOrPath, mask: int, *, flags: int = 0, dir_fd: int | None = None, follow_symlinks: bool = True
1399+
) -> statx_result: ...
1400+
12851401
def symlink(
12861402
src: StrOrBytesPath, dst: StrOrBytesPath, target_is_directory: bool = False, *, dir_fd: int | None = None
12871403
) -> None: ...

stdlib/posix.pyi

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,33 @@ if sys.platform != "win32":
266266
if sys.version_info >= (3, 15):
267267
from os import NODEV as NODEV
268268

269+
if sys.version_info >= (3, 15) and sys.platform == "linux":
270+
from os import (
271+
AT_NO_AUTOMOUNT as AT_NO_AUTOMOUNT,
272+
AT_STATX_DONT_SYNC as AT_STATX_DONT_SYNC,
273+
AT_STATX_FORCE_SYNC as AT_STATX_FORCE_SYNC,
274+
AT_STATX_SYNC_AS_STAT as AT_STATX_SYNC_AS_STAT,
275+
STATX_ATIME as STATX_ATIME,
276+
STATX_BASIC_STATS as STATX_BASIC_STATS,
277+
STATX_BLOCKS as STATX_BLOCKS,
278+
STATX_BTIME as STATX_BTIME,
279+
STATX_CTIME as STATX_CTIME,
280+
STATX_DIOALIGN as STATX_DIOALIGN,
281+
STATX_GID as STATX_GID,
282+
STATX_INO as STATX_INO,
283+
STATX_MNT_ID as STATX_MNT_ID,
284+
STATX_MNT_ID_UNIQUE as STATX_MNT_ID_UNIQUE,
285+
STATX_MODE as STATX_MODE,
286+
STATX_MTIME as STATX_MTIME,
287+
STATX_NLINK as STATX_NLINK,
288+
STATX_SIZE as STATX_SIZE,
289+
STATX_TYPE as STATX_TYPE,
290+
STATX_UID as STATX_UID,
291+
_clearenv as _clearenv,
292+
statx as statx,
293+
statx_result as statx_result,
294+
)
295+
269296
if sys.platform != "darwin":
270297
from os import (
271298
POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED,

stdlib/tkinter/simpledialog.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import sys
12
from tkinter import Event, Frame, Misc, Toplevel
23

4+
if sys.version_info >= (3, 15):
5+
__all__ = ["SimpleDialog", "Dialog", "askinteger", "askfloat", "askstring"]
6+
37
class Dialog(Toplevel):
48
def __init__(self, parent: Misc | None, title: str | None = None) -> None: ...
59
def body(self, master: Frame) -> Misc | None: ...

stdlib/winreg.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ if sys.platform == "win32":
1212
def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ...
1313
def DeleteKey(key: _KeyType, sub_key: str, /) -> None: ...
1414
def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ...
15+
if sys.version_info >= (3, 15):
16+
def DeleteTree(key: _KeyType, sub_key: str | None = None, /) -> None: ...
17+
1518
def DeleteValue(key: _KeyType, value: str, /) -> None: ...
1619
def EnumKey(key: _KeyType, index: int, /) -> str: ...
1720
def EnumValue(key: _KeyType, index: int, /) -> tuple[str, Any, int]: ...

stdlib/xml/etree/ElementTree.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ from typing_extensions import deprecated, disjoint_base
77
from xml.parsers.expat import XMLParserType
88

99
__all__ = [
10-
"C14NWriterTarget",
1110
"Comment",
1211
"dump",
1312
"Element",
@@ -27,13 +26,16 @@ __all__ = [
2726
"tostring",
2827
"tostringlist",
2928
"TreeBuilder",
30-
"VERSION",
3129
"XML",
3230
"XMLID",
3331
"XMLParser",
3432
"XMLPullParser",
3533
"register_namespace",
34+
"canonicalize",
35+
"C14NWriterTarget",
3636
]
37+
if sys.version_info < (3, 15):
38+
__all__ += ["VERSION"]
3739

3840
_T = TypeVar("_T")
3941
_FileRead: TypeAlias = FileDescriptorOrPath | SupportsRead[bytes] | SupportsRead[str]

0 commit comments

Comments
 (0)