You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce warnings for Python 3.15 enum compatibility and improve test stability. (#907)
* docs: Add note about Python 3.15 `enum` behavior in `README.md`.
Explain that `IntFlag` values for negative enum members may be reinterpreted
in Python 3.15+, affecting `comtypes` generated enums.
* feat: Add `FutureWarning` for Python 3.15 `enum` behavior.
Introduces a `FutureWarning` in `__init__.py` for Python 3.15 and later to
notify users about potential changes in `enum` handling, specifically
`IntFlag` values.
* test: Improve Python 3.15 `enum` test clarity.
Conditionally skip `test_enums_in_friendly_mod` on Python 3.15 alpha/beta
versions in `test_client.py` to prevent failures due to
potential `IntFlag` changes. This change includes adding `subTest` messages
for better debugging.
Additionally, refactor enum member access in `test_puredispatch.py`
from `msi.MsiInstallState.msiInstallStateUnknown` to
`msi.msiInstallStateUnknown` for improved clarity and consistency.
* test: Prevent memory errors in `from_outparam` test.
The test now uses `create_unicode_buffer` to safely allocate a valid
memory block outside of the COM allocator's control. This ensures
the test correctly validates the behavior of `from_outparam` on
unmanaged memory without causing access violations.
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,12 @@
12
12
`comtypes` allows you to define, call, and implement custom and dispatch-based COM interfaces in pure Python.
13
13
14
14
`comtypes` requires Windows and Python 3.9 or later.
15
+
16
+
-**Note about Python 3.15 and `enum` behavior**
17
+
Starting with Python 3.15, the internal handling of `IntFlag`(`Flag`) values is planned to change:
18
+
**Negative `IntFlag` members will be reinterpreted by masking them to the defined positive bit domain, instead of keeping their original negative literal values**.
19
+
This can affect enumeration types generated by `comtypes` from COM type libraries. Action is needed to maintain literal evaluation.
20
+
For details and ongoing discussion, see: [GH-894](https://github.com/enthought/comtypes/issues/894).
15
21
- Version [1.4.12](https://pypi.org/project/comtypes/1.4.12/) is the last version to support Python 3.8.
16
22
- Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
17
23
- Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
0 commit comments