[New-bugs-announce] [issue44220] PyStructSequence_UnnamedField unavailable on Windows

John Nelson report at bugs.python.org
Sun May 23 19:40:00 EDT 2021

New submission from John Nelson <john at jnelson.ca>:

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

  # Raises AttributeError

components: Interpreter Core, Windows
messages: 394226
nosy: johnboy2, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: PyStructSequence_UnnamedField unavailable on Windows
type: behavior
versions: Python 3.7, Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list