Title: PyStructSequence_UnnamedField not exported
Type: compile error Stage:
Components: Windows Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson,, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-08-19 12:43 by, last changed 2019-08-21 12:44 by ZackerySpytz.

File name Uploaded Description Edit
structseq.h, 2019-08-19 15:54
Messages (2)
msg349956 - (view) Author: Jeff Robbins ( * Date: 2019-08-19 12:43
Python 3.8.0b3 has the fixed, but one of the documented features of PyStructSequence is the special 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 ( * Date: 2019-08-19 15:54
Editing one line in structseq.h seems to fix the issue.

I changed this

extern char* PyStructSequence_UnnamedField;


PyAPI_DATA(char*) PyStructSequence_UnnamedField;

rebuilt, and now my C extension can use PyStructSequence_UnnamedField.
Date User Action Args
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