-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comtypes.client.GetModule("UIAutomationCore.dll") failed in python 3.7.6 #202
Comments
This is wrong fix in Python 3.7.6 and 3.8.1. This is already reverted in Python (3.8.2rc1 is in validation now, so there is a hope to release Python 3.8.2 where it should work). Now just install earlier Python version. The core of the problem is a missing feature in libffi (this is calling convention handling library used by ctypes for Python/C integration). But this feature is unlikely to be implemented soon. |
Thanks. |
I also have the problem: |
Hi @Wang-zhipeng this is completely different problem. First you need to know that |
I use pyinstaller build to exe, and run exe on another system that has no python environment, it can't run. my python version 3.9.4,UIAutomation version 2.0.15 |
Note: From python/cpython#16799 (comment)
|
It worked in 3.7.3, but failed in 3.7.6.
Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 18 2019, 23:46:00) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import comtypes
import comtypes.client
comtypes.client.GetModule("UIAutomationCore.dll")
Traceback (most recent call last):
File "D:\Python37\lib\ctypes_init_.py", line 121, in WINFUNCTYPE
return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'ctypes.c_long'>, <class 'comtypes.automation.tagVARIANT'>, <class 'comtypes.LP_POINTER(IUIAutomationCondition)'>), 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "D:\Python37\lib\site-packages\comtypes\client_generate.py", line 110, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "D:\Python37\lib\site-packages\comtypes\client_generate.py", line 184, in _CreateWrapper
mod = _my_import(fullname)
File "D:\Python37\lib\site-packages\comtypes\client_generate.py", line 24, in my_import
return import(fullname, globals(), locals(), ['DUMMY'])
File "D:\Python37\lib\site-packages\comtypes\gen_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py", line 1244, in
( ['out', 'retval'], POINTER(POINTER(IUIAutomationElement)), 'element' )),
File "D:\Python37\lib\site-packages\comtypes_init.py", line 329, in setattr
self.make_methods(value)
File "D:\Python37\lib\site-packages\comtypes_init.py", line 698, in make_methods
prototype = WINFUNCTYPE(restype, *argtypes)
File "D:\Python37\lib\ctypes_init.py", line 123, in WINFUNCTYPE
class WinFunctionType(_CFuncPtr):
TypeError: item 2 in argtypes passes a union by value, which is unsupported.
The text was updated successfully, but these errors were encountered: