From 5d3dc01b81f997e756439e42e4eb018e53ed201f Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 5 Jun 2026 20:20:42 -0400 Subject: [PATCH 1/4] Bump pywin32 to 312 --- .../@tests/stubtest_allowlist_win32.txt | 29 ++++++++----------- stubs/pywin32/METADATA.toml | 2 +- stubs/pywin32/_win32typing.pyi | 11 +++++++ stubs/pywin32/pythonwin/win32ui.pyi | 1 - stubs/pywin32/win32/lib/win32con.pyi | 3 -- stubs/pywin32/win32/lib/win32timezone.pyi | 4 ++- stubs/pywin32/win32/win32api.pyi | 1 + stubs/pywin32/win32/win32clipboard.pyi | 1 - stubs/pywin32/win32/win32gui.pyi | 2 +- .../win32comext/axdebug/codecontainer.pyi | 2 -- 10 files changed, 29 insertions(+), 27 deletions(-) diff --git a/stubs/pywin32/@tests/stubtest_allowlist_win32.txt b/stubs/pywin32/@tests/stubtest_allowlist_win32.txt index 37ea55f8e223..94b69abb0119 100644 --- a/stubs/pywin32/@tests/stubtest_allowlist_win32.txt +++ b/stubs/pywin32/@tests/stubtest_allowlist_win32.txt @@ -1,6 +1,9 @@ # Not available at runtime. Contains type definitions that are otherwise not exposed _win32typing +# False-positive, stubtest shouldn't want to expose TYPE_CHECKING +(win32\.lib\.)?pywintypes\.TYPE_CHECKING + # PyWin tool / debugger pythonwin.start_pythonwin pythonwin.pywin.* @@ -32,9 +35,9 @@ win32com(ext)?.axscript.client.scriptdispatch win32com.demos.* win32com.servers.test_pycomtest win32com.test.* -win32com(ext)?.axdebug.codecontainer +win32com.axdebug.codecontainer win32com(ext)?.axdebug.dump -win32com(ext)?.axdebug.debugger +win32com.axdebug.debugger win32com(ext)?.axscript.client.pydumper win32com(ext)?.directsound.test.* @@ -42,19 +45,11 @@ win32com(ext)?.directsound.test.* # It's safer to not even expose this method as deprecated. (win32.)?win32gui.PyMakeBuffer -# Axdebug is not built on Python 3.11 anyway: https://github.com/mhammond/pywin32/blob/c0f06cf49252b4848d0c74832247280291b00b03/setup.py#L386-L390 -# # failed to import, ImportError: DLL load failed while importing axdebug: The specified module could not be found. -win32com(ext)?.axdebug.axdebug -win32com(ext)?.axdebug.codecontainer -# failed to import, ModuleNotFoundError: No module named 'gateways' -win32com(ext)?.axdebug.contexts -# failed to import, ModuleNotFoundError: No module named 'axdebug' -win32com(ext)?.axdebug.adb -win32com(ext)?.axdebug.documents -win32com(ext)?.axdebug.expressions -# failed to import, ModuleNotFoundError: No module named 'expressions' -win32com(ext)?.axdebug.stackframe -# failed to import, ImportError: cannot import name 'axdebug' from 'win32com.axdebug' -win32com(ext)?.axdebug.gateways -win32com(ext)?.axscript.client.debug +win32com.axdebug.adb +win32com.axdebug.axdebug +win32com.axdebug.contexts +win32com.axdebug.documents +win32com.axdebug.expressions +win32com.axdebug.gateways +win32com.axdebug.stackframe diff --git a/stubs/pywin32/METADATA.toml b/stubs/pywin32/METADATA.toml index 7e375492009f..9608b4255d06 100644 --- a/stubs/pywin32/METADATA.toml +++ b/stubs/pywin32/METADATA.toml @@ -1,4 +1,4 @@ -version = "311.*" +version = "312.*" upstream_repository = "https://github.com/mhammond/pywin32" [tool.stubtest] diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index 38d9d578b468..1de995fefb45 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -6169,3 +6169,14 @@ class HTTP_FILTER_VERSION: def Flags(self): ... @property def FilterDesc(self) -> str: ... + +class PySYSTEM_CPU_SET_INFORMATION: + Id: int + Group: int + LogicalProcessorIndex: int + CoreIndex: int + LastLevelCacheIndex: int + NumaNodeIndex: int + EfficiencyClass: int + SchedulingClass: int + AllocationTag: int diff --git a/stubs/pywin32/pythonwin/win32ui.pyi b/stubs/pywin32/pythonwin/win32ui.pyi index b9ea26ca26e6..c1e2c0346925 100644 --- a/stubs/pywin32/pythonwin/win32ui.pyi +++ b/stubs/pywin32/pythonwin/win32ui.pyi @@ -368,7 +368,6 @@ IDC_TABTIMMY_NONE: int IDC_VIEW_EOL: int IDC_VIEW_INDENTATIONGUIDES: int ID_VIEW_FOLD_TOPLEVEL: int -UNICODE: int copyright: str dllhandle: int types: dict[str, type] diff --git a/stubs/pywin32/win32/lib/win32con.pyi b/stubs/pywin32/win32/lib/win32con.pyi index 6a7da2eb4913..1322355791df 100644 --- a/stubs/pywin32/win32/lib/win32con.pyi +++ b/stubs/pywin32/win32/lib/win32con.pyi @@ -2102,9 +2102,6 @@ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Final = 8192 FILE_ATTRIBUTE_ENCRYPTED: Final = 16384 FILE_ATTRIBUTE_VIRTUAL: Final = 65536 -FILE_ATTRIBUTE_ATOMIC_WRITE: Final = 512 -FILE_ATTRIBUTE_XACTION_WRITE: Final = 1024 - FILE_NOTIFY_CHANGE_FILE_NAME: Final = 1 FILE_NOTIFY_CHANGE_DIR_NAME: Final = 2 FILE_NOTIFY_CHANGE_ATTRIBUTES: Final = 4 diff --git a/stubs/pywin32/win32/lib/win32timezone.pyi b/stubs/pywin32/win32/lib/win32timezone.pyi index 2d254c0ce43f..c8d58c18a3a4 100644 --- a/stubs/pywin32/win32/lib/win32timezone.pyi +++ b/stubs/pywin32/win32/lib/win32timezone.pyi @@ -4,7 +4,7 @@ from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Iterable, Mapping from logging import Logger from typing import ClassVar, TypeVar, overload, type_check_only -from typing_extensions import Self +from typing_extensions import Self, disjoint_base _RangeMapKT = TypeVar("_RangeMapKT", bound=_SupportsComparison) @@ -107,6 +107,8 @@ class RangeMap(dict[_RangeMapKT, _VT]): undefined_value: RangeValueUndefined + @disjoint_base class Item(int): ... + first_item: Item last_item: Item diff --git a/stubs/pywin32/win32/win32api.pyi b/stubs/pywin32/win32/win32api.pyi index 1577e5e95c6d..6534296f1c34 100644 --- a/stubs/pywin32/win32/win32api.pyi +++ b/stubs/pywin32/win32/win32api.pyi @@ -159,6 +159,7 @@ def GetProfileVal(section: str, entry: str, defValue: str, iniName: str | None = def GetShortPathName(path: str, /) -> str: ... def GetStdHandle(handle: int, /) -> int: ... def GetSysColor(index: int, /) -> int: ... +def GetSystemCpuSetInformation() -> list[_win32typing.PySYSTEM_CPU_SET_INFORMATION]: ... def GetSystemDefaultLangID() -> int: ... def GetSystemDefaultLCID() -> int: ... def GetSystemDirectory() -> str: ... diff --git a/stubs/pywin32/win32/win32clipboard.pyi b/stubs/pywin32/win32/win32clipboard.pyi index 355b97a533c0..27ed86573bbe 100644 --- a/stubs/pywin32/win32/win32clipboard.pyi +++ b/stubs/pywin32/win32/win32clipboard.pyi @@ -46,4 +46,3 @@ CF_TEXT: Final[int] CF_TIFF: Final[int] CF_UNICODETEXT: Final[int] CF_WAVE: Final[int] -UNICODE: bool diff --git a/stubs/pywin32/win32/win32gui.pyi b/stubs/pywin32/win32/win32gui.pyi index 9d58f6c72979..ac1a1467b7e0 100644 --- a/stubs/pywin32/win32/win32gui.pyi +++ b/stubs/pywin32/win32/win32gui.pyi @@ -557,5 +557,5 @@ TPM_RIGHTALIGN: int TPM_RIGHTBUTTON: int TPM_TOPALIGN: int TPM_VCENTERALIGN: int -UNICODE: Literal[True] +UNICODE: Literal[1] dllhandle: int diff --git a/stubs/pywin32/win32comext/axdebug/codecontainer.pyi b/stubs/pywin32/win32comext/axdebug/codecontainer.pyi index 62bc0606ab19..29dbc568a34b 100644 --- a/stubs/pywin32/win32comext/axdebug/codecontainer.pyi +++ b/stubs/pywin32/win32comext/axdebug/codecontainer.pyi @@ -1,7 +1,5 @@ from _typeshed import Incomplete -name: str - class SourceCodeContainer: sourceContext: Incomplete text: Incomplete From 6dd2db5ff69d08843250f78c5837efd80898002a Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 5 Jun 2026 20:29:15 -0400 Subject: [PATCH 2/4] Discard changes to stubs/pywin32/win32/lib/win32timezone.pyi --- stubs/pywin32/win32/lib/win32timezone.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stubs/pywin32/win32/lib/win32timezone.pyi b/stubs/pywin32/win32/lib/win32timezone.pyi index 71570db3a73a..15508cc26158 100644 --- a/stubs/pywin32/win32/lib/win32timezone.pyi +++ b/stubs/pywin32/win32/lib/win32timezone.pyi @@ -4,7 +4,7 @@ from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Iterable, Mapping from logging import Logger from typing import ClassVar, TypeVar, overload, type_check_only -from typing_extensions import Self, disjoint_base +from typing_extensions import Self _RangeMapKT = TypeVar("_RangeMapKT", bound=_SupportsComparison) @@ -115,8 +115,6 @@ class RangeMap(dict[_RangeMapKT, _VT]): undefined_value: RangeValueUndefined - @disjoint_base class Item(int): ... - first_item: Item last_item: Item From 5f34c4e373289d72c0fb5900f3a5d9041f395959 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 5 Jun 2026 20:42:07 -0400 Subject: [PATCH 3/4] axdebug is now built on Python 3.11, but still fails import --- .../@tests/stubtest_allowlist_win32.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stubs/pywin32/@tests/stubtest_allowlist_win32.txt b/stubs/pywin32/@tests/stubtest_allowlist_win32.txt index 64149bc73e27..4ca47866f755 100644 --- a/stubs/pywin32/@tests/stubtest_allowlist_win32.txt +++ b/stubs/pywin32/@tests/stubtest_allowlist_win32.txt @@ -31,9 +31,7 @@ win32com(ext)?.axscript.client.scriptdispatch win32com.demos.* win32com.servers.test_pycomtest win32com.test.* -win32com.axdebug.codecontainer win32com(ext)?.axdebug.dump -win32com.axdebug.debugger win32com(ext)?.axscript.client.pydumper win32com(ext)?.directsound.test.* @@ -42,10 +40,12 @@ win32com(ext)?.directsound.test.* (win32.)?win32gui.PyMakeBuffer # failed to import, ImportError: DLL load failed while importing axdebug: The specified module could not be found. -win32com.axdebug.adb -win32com.axdebug.axdebug -win32com.axdebug.contexts -win32com.axdebug.documents -win32com.axdebug.expressions -win32com.axdebug.gateways -win32com.axdebug.stackframe +win32com(ext)?.axdebug.adb +win32com(ext)?.axdebug.axdebug +win32com(ext)?.axdebug.codecontainer +win32com(ext)?.axdebug.contexts +win32com(ext)?.axdebug.debugger +win32com(ext)?.axdebug.documents +win32com(ext)?.axdebug.expressions +win32com(ext)?.axdebug.gateways +win32com(ext)?.axdebug.stackframe From 0289637590ca4c09b57a7652ea89879ae2235de0 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 5 Jun 2026 21:53:00 -0400 Subject: [PATCH 4/4] Add deprecated comment --- stubs/pywin32/pythoncom.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/pywin32/pythoncom.pyi b/stubs/pywin32/pythoncom.pyi index 3ab9e851e98f..83404871ff7a 100644 --- a/stubs/pywin32/pythoncom.pyi +++ b/stubs/pywin32/pythoncom.pyi @@ -496,4 +496,5 @@ fdexPropCannotPutRef: int fdexPropCannotSourceEvents: int fdexPropDynamicType: int fdexPropNoSideEffects: int +# Deprecated: Use `getattr(sys, "frozen", False)` directly instead. frozen: int