gh-131747: ctypes: Deprecate _pack_ implicitly setting _layout_ = 'ms' (GH-133205)

On non-Windows, warn when _pack_ implicitly changes default _layout_
to 'ms'.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
Petr Viktorin 2025-05-05 15:32:06 +02:00 committed by GitHub
parent f554237b8e
commit 59f78d7b06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 115 additions and 16 deletions

View file

@ -1874,6 +1874,12 @@ Deprecated
:func:`codecs.open` is now deprecated. Use :func:`open` instead.
(Contributed by Inada Naoki in :gh:`133036`.)
* :mod:`ctypes`:
On non-Windows platforms, setting :attr:`.Structure._pack_` to use a
MSVC-compatible default memory layout is deprecated in favor of setting
:attr:`.Structure._layout_` to ``'ms'``.
(Contributed by Petr Viktorin in :gh:`131747`.)
* :mod:`ctypes`:
Calling :func:`ctypes.POINTER` on a string is deprecated.
Use :ref:`ctypes-incomplete-types` for self-referential structures.
@ -1948,6 +1954,8 @@ Deprecated
.. include:: ../deprecations/pending-removal-in-3.17.rst
.. include:: ../deprecations/pending-removal-in-3.19.rst
.. include:: ../deprecations/pending-removal-in-future.rst
Removed