[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: Stéphane Wirtel: "In fact, _Py_ctype_table is limited to the internal parts of the interpreter. So in this case, this one could not be used in an external tool. You can read: https://docs.python.org/3/c-api/stable.html; You're right that pyctype.h is

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: The workaround for this issue is to put extern "C" around #include , or around the header file which includes . -- ___ Python tracker ___

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: It's now fixed. Thanks Andrew V. Jones for the fix. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 ___ Python tracker

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 15ad30d88fead718b7eeff8c54454b82753d520e by Miss Islington (bot) in branch '3.9': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) (GH-25387) https://github.com/python/cpython/commit/15ad30d88fead718b7eeff8c54454b82753d520e

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread miss-islington
miss-islington added the comment: New changeset 47a894d338f436ea8f513f1ad2cc7e1b086e99cc by Miss Islington (bot) in branch '3.8': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) https://github.com/python/cpython/commit/47a894d338f436ea8f513f1ad2cc7e1b086e99cc --

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +24120 pull_request: https://github.com/python/cpython/pull/25387 ___ Python tracker ___

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24119 pull_request: https://github.com/python/cpython/pull/25386 ___ Python tracker

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 54db51c9114ac49030832f5134979ca866ffd21c by Andrew V. Jones in branch 'master': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) https://github.com/python/cpython/commit/54db51c9114ac49030832f5134979ca866ffd21c --

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-13 Thread Stefan Behnel
Stefan Behnel added the comment: The macros were moved to "Includes/cpython/", not to "Includes/internal/". That suggests to me that they should use "extern C", so that C++ code that wants to make use of CPython internals can use them. Basically, the way I see it, *all* header files in

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread STINNER Victor
STINNER Victor added the comment: See https://github.com/python/cpython/blob/master/Include/README.rst for the organization of the C API. -- ___ Python tracker ___

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
Andrew V. Jones added the comment: > I think the fact that they've been moved to Include/cpython means that user > code shouldn't be using them. > I think it is fine to say that they shouldn't be used, but then we get this from Victor's blog: > It was decided that internal header files must

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Eric V. Smith
Eric V. Smith added the comment: These files were probably added as part of str.format() or short float repr. I think the fact that they've been moved to Include/cpython means that user code shouldn't be using them. See https://bugs.python.org/issue35134 and

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: These macros are a sort-of documented part of the C-API. At least, they were mentioned in a What's New document: https://docs.python.org/3/whatsnew/2.7.html?highlight=py_isspace#build-and-c-api-changes They were added here, for the Py2.7 release:

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
Andrew V. Jones added the comment: > 1) The Cython-generated code uses `Py_ISSPACE` (and not `_Py_ctype_table`), > but the expansion of the macro `Py_ISSPACE` then adds `_Py_ctype_table` to > the user's code > I wrote this up as a Cython bug here (just to see if the Cython team consider

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +C API ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
Andrew V. Jones added the comment: > I am happy to re-assign this as a Cython bug, but the fact it is fixed with > an `extern "C"` in Python.h, really makes it feel like it is a Python-proper > issue and not a "user" issue. > Just to extend on this: 1) The Cython-generated code uses

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
Andrew V. Jones added the comment: > In fact, _Py_ctype_table is limited to the internal parts of the interpreter. > So in this case, this one could not be used in an external tool. > Hmm, so why is this "exposed" by the "world-facing" `Python.h` file? I should say: we found this bug via

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: In fact, _Py_ctype_table is limited to the internal parts of the interpreter. So in this case, this one could not be used in an external tool. You can read: https://docs.python.org/3/c-api/stable.html I am not sure that you correctly use the API.

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
Change by Andrew V. Jones : -- keywords: +patch pull_requests: +24099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25365 ___ Python tracker ___

[issue43816] Missing 'extern "C"' for _Py_ctype_table

2021-04-12 Thread Andrew V. Jones
New submission from Andrew V. Jones : With Python 3.9.4, and when compiling with Visual Studio 2019, we have noticed that the variable `_Py_ctype_table` is *not* scoped with in an `extern "C"` block, and where the Python library (`python39.lib`) *has* been compiled with a C compiler. This