-
-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Hello, comtypesers,
Python 3.14 beta 1 is scheduled for release on May 6, 2025.
We recognize that it's time to begin preparations to ensure that comtypes continues to function reliably both on this upcoming version and on all currently supported versions (up to 3.13).
As many of you know, comtypes heavily depends on Python’s foreign function interface library, ctypes.
One major upcoming change in Python 3.14 is an internal update to the ctypes.POINTER() caching mechanism (cpython/issues/100926, cpython/pull/131282, ctypes._CData.__pointer_type__ documentation).
This change is not immediately backward-incompatible in Python 3.14.
The old pointer caching mechanism will be deprecated and will issue a DeprecationWarning, but it remains functional in 3.14.
However, as shown below, this mechanism is scheduled for removal in Python 3.19.
PS current\dir> ...\cpython\PCbuild\amd64\python.exe -m unittest discover -v -s ./comtypes/test -t comtypes\test
...
...\comtypes\_post_coinit\unknwn.py:131: DeprecationWarning: 'ctypes._pointer_type_cache' is deprecated and slated for removal in Python 3.19
_pointer_type_cache[self] = pThis removal will prevent comtypes from working correctly unless its production codebase is modified.
To mitigate the impact of this change, I’ve been working closely with CPython contributors, engaging in discussions on the related issue and pull request.
As a result, I now have a clear technical strategy for updating comtypes to remain compatible with Python 3.14 (cpython PR comment).
Moreover, the proposed fix has been reviewed by CPython contributors and confirmed to be consistent with the direction of ctypes design and implementation (cpython PR comment).
Once Python 3.14 beta 1 is out, and after we've made a revision release of comtypes, I plan to merge the necessary compatibility changes into the main branch. I might start by opening a draft PR.
Here’s how the community can help: we would greatly appreciate it if you could test the "supporting python 3.14" branch in your environment.
If you encounter any issues—such as errors or unexpected behavior—please report them along with detailed reproduction steps and any error messages you receive.
This information will be invaluable in helping us investigate and fix any problems.
Your feedback, whether it's suggestions or test results, is always welcome.
Community contributions are vital to ensuring comtypes remains stable and compatible with the latest Python versions.
Thank you!