This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PyStructSequence_UnnamedField unavailable on Windows
Type: behavior Stage: resolved
Components: Interpreter Core, Windows Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: johnboy2, kj, paul.moore, petr.viktorin, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2021-05-23 23:40 by johnboy2, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26331 merged kj, 2021-05-24 14:16
Messages (3)
msg394226 - (view) Author: John Nelson (johnboy2) * Date: 2021-05-23 23:40
The symbol "PyStructSequence_UnnnamedField" is not *explicitly* marked for export, causing it to be omitted from python3x.dll on Windows -- and thus unavailable to Windows extension modules.

Attempting to use this symbol then fails at link time:
  test.obj : error LNK2001: unresolved external symbol PyStructSequence_UnnamedField
  build\lib.win-amd64-3.7\test.cp39-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals

The fact that the symbol is missing can also be demonstrated via ctypes:
  import ctypes
  from pathlib import Path
  import sys

  python_dll = ctypes.CDLL(str(Path(sys.executable).parent / 'python3.dll'))

  # These don't raise at all
  python_dll.PyTuple_Type
  python_dll.PyStructSequence_New

  # Raises AttributeError
  python_dll.PyStructSequence_UnnamedField
msg404572 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2021-10-21 08:47
New changeset 2cbf50e8126905b57ba9d0d5aa4e238c817d5a03 by Ken Jin in branch 'main':
bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331)
https://github.com/python/cpython/commit/2cbf50e8126905b57ba9d0d5aa4e238c817d5a03
msg404574 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2021-10-21 09:06
It should be available in python3x.dll (e.g. pyhon310.dll).
It  is  not  available in python3.dll  (the stable ABI), until Python 3.11.
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88386
2022-01-23 18:58:56iritkatriellinkissue37886 superseder
2021-10-21 09:06:51petr.viktorinsetstatus: open -> closed
versions: + Python 3.11, - Python 3.7, Python 3.9
messages: + msg404574

resolution: fixed
stage: patch review -> resolved
2021-10-21 08:47:20petr.viktorinsetnosy: + petr.viktorin
messages: + msg404572
2021-05-24 14:16:25kjsetkeywords: + patch
nosy: + kj

pull_requests: + pull_request24923
stage: patch review
2021-05-23 23:40:00johnboy2create