From 9afae1f2c00157b6f0dca4f43d40b59a47770aa8 Mon Sep 17 00:00:00 2001 From: Christian Fersch Date: Wed, 22 Nov 2023 14:18:42 +0100 Subject: [PATCH] Fix named arguments in win32com.client.dynamic.Dispatch If any `Missing` argument value is encountered, argument processing stopped and any later arguments are not processed. This causes us to silently ignore named arguments that are later in the argument order. The value of pythoncom.Empty is chosen to be consistent with the genpy code. --- com/win32com/client/build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/com/win32com/client/build.py b/com/win32com/client/build.py index 1035ecdff..8810f0c51 100644 --- a/com/win32com/client/build.py +++ b/com/win32com/client/build.py @@ -363,9 +363,9 @@ def MakeDispatchFuncMethod(self, entry, name, bMakeClass=1): defUnnamedArg = "defaultUnnamedArg" else: linePrefix = "" - defNamedOptArg = "pythoncom.Missing" - defNamedNotOptArg = "pythoncom.Missing" - defUnnamedArg = "pythoncom.Missing" + defNamedOptArg = "pythoncom.Empty" + defNamedNotOptArg = "pythoncom.Empty" + defUnnamedArg = "pythoncom.Empty" defOutArg = "pythoncom.Missing" id = fdesc[0]