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 not exported
Type: compile error Stage: resolved
Components: Windows Versions: Python 3.8
process
Status: closed Resolution: duplicate
Dependencies: Superseder: PyStructSequence_UnnamedField unavailable on Windows
View: 44220
Assigned To: Nosy List: benjamin.peterson, jeffr@livedata.com, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-08-19 12:43 by jeffr@livedata.com, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
structseq.h jeffr@livedata.com, 2019-08-19 15:54
Messages (2)
msg349956 - (view) Author: Jeff Robbins (jeffr@livedata.com) * Date: 2019-08-19 12:43
Python 3.8.0b3 has the fixed https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_NewType, but one of the documented features of PyStructSequence is the special https://docs.python.org/3/c-api/tuple.html#c.PyStructSequence_UnnamedField which is meant to be used for unnamed (and presumably also "hidden") fields.

However, this variable is not "exported" (via __declspec(dllexport) or the relevant Python C macro) and so my C extension cannot "import" it and use it.

My guess is that this passed testing because the only tests using it are internal modules linked into python38.dll, which are happy with the `extern` in the header:

Include\structseq.h:extern char* PyStructSequence_UnnamedField;
msg349961 - (view) Author: Jeff Robbins (jeffr@livedata.com) * Date: 2019-08-19 15:54
Editing one line in structseq.h seems to fix the issue.

I changed this

extern char* PyStructSequence_UnnamedField;

to

PyAPI_DATA(char*) PyStructSequence_UnnamedField;

rebuilt, and now my C extension can use PyStructSequence_UnnamedField.
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82067
2022-01-23 18:58:56iritkatrielsetstatus: open -> closed
superseder: PyStructSequence_UnnamedField unavailable on Windows
resolution: duplicate
stage: resolved
2019-08-21 12:44:00ZackerySpytzsetnosy: + benjamin.peterson
2019-08-19 15:54:06jeffr@livedata.comsetfiles: + structseq.h

messages: + msg349961
2019-08-19 12:43:49jeffr@livedata.comcreate