classification
Title: PyStructSequence_UnnamedField not exported
Type: compile error Stage:
Components: Windows Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
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 2019-08-21 12:44 by ZackerySpytz.

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
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