[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5c3cda0d1a850a1a9b43892f48376b8876bd5863 by Victor Stinner in 
branch 'master':
bpo-39947: Add PyThreadState_GetID() function (GH-19163)
https://github.com/python/cpython/commit/5c3cda0d1a850a1a9b43892f48376b8876bd5863


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0e427c6d159e86f17270770cd8dc37372e3c4004 by Victor Stinner in 
branch 'master':
bpo-39947: Add _PyThreadState_GetDict() function (GH-19160)
https://github.com/python/cpython/commit/0e427c6d159e86f17270770cd8dc37372e3c4004


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3072338642156a5edfa2deef2557288fff73c22a by Victor Stinner in 
branch 'master':
bpo-39947: Use PyThreadState_GetFrame() (GH-19159)
https://github.com/python/cpython/commit/3072338642156a5edfa2deef2557288fff73c22a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18520
pull_request: https://github.com/python/cpython/pull/19160

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18523
pull_request: https://github.com/python/cpython/pull/19163

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18519
pull_request: https://github.com/python/cpython/pull/19159

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-20 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b by Victor Stinner in 
branch 'master':
bpo-39947: Add PyThreadState_GetFrame() function (GH-19092)
https://github.com/python/cpython/commit/fd1e1a18fa3befe5b6eeac32e0561e15c7e5164b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-20 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18452
pull_request: https://github.com/python/cpython/pull/19092

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I added PyInterpreterState_Get() and PyThreadState_GetInterpreter() functions 
to get the interpreter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8fb02b6e1942811c8d81041e7df3f5f1f4b1d410 by Victor Stinner in 
branch 'master':
bpo-39947: Add PyThreadState_GetInterpreter() (GH-18981)
https://github.com/python/cpython/commit/8fb02b6e1942811c8d81041e7df3f5f1f4b1d410


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset be79373a78c0d75fc715ab64253c9b757987a848 by Victor Stinner in 
branch 'master':
bpo-39947: Add PyInterpreterState_Get() function (GH-18979)
https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18329
pull_request: https://github.com/python/cpython/pull/18981

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ff4584caca04cb3da0dbd5b1e9bf67e40adf5312 by Victor Stinner in 
branch 'master':
bpo-39947: Use _PyInterpreterState_GET_UNSAFE() (GH-18978)
https://github.com/python/cpython/commit/ff4584caca04cb3da0dbd5b1e9bf67e40adf5312


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18327
pull_request: https://github.com/python/cpython/pull/18979

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18326
pull_request: https://github.com/python/cpython/pull/18978

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor

STINNER Victor  added the comment:

I tested to build numpy with an opaque PyThreadState. First issue, Plex gets 
the current interpreter using PyThreadState.interp:

/tmp/pip-install-aq60p8w2/Cython/Cython/Plex/Scanners.c:7447:73: erreur: 
déréférencement d'un pointeur du type incomplet « PyThreadState » {alias « 
struct _ts »}
 7447 | PY_INT64_T current_id = 
PyInterpreterState_GetID(PyThreadState_Get()->interp);

We should add a PyThreadState_GetInterpreter(tstate) getter. 
faulthandler_py_enable() would use it for example.

Maybe _PyInterpreterState_Get() can be used, but it's a private function. There 
are also _PyThreadState_UncheckedGet() and 
_PyGILState_GetInterpreterStateUnsafe() which are worse: don't check for NULL 
pointers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 38965ec5411da60d312b59be281f3510d58e0cf1 by Victor Stinner in 
branch 'master':
bpo-39947: Hide implementation detail of trashcan macros (GH-18971)
https://github.com/python/cpython/commit/38965ec5411da60d312b59be281f3510d58e0cf1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd by Victor Stinner in 
branch 'master':
bpo-39947: Move get_recursion_depth() to _testinternalcapi (GH-18974)
https://github.com/python/cpython/commit/3f2f4fefca388bc62fc2a7d07cb6ef24197c84bd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:

> As a note, externally I have to use it in pydevd to set the tracing for 
> different threads -- i.e.: https://bugs.python.org/issue35370 Will that still 
> be possible?

My intent is not to prevent third-party C extension modules to modify 
PyThreadState, but to make the structure opaque. I mean that we should add 
getter and setter function for the most commonly used PyThreadState fields.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

As a note, externally I have to use it in pydevd to set the tracing for 
different threads -- i.e.: https://bugs.python.org/issue35370

Will that still be possible?

--
nosy: +fabioz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18323
pull_request: https://github.com/python/cpython/pull/18974

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 224481a8c988fca12f488544edd2f01c0af2a91d by Victor Stinner in 
branch 'master':
bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)
https://github.com/python/cpython/commit/224481a8c988fca12f488544edd2f01c0af2a91d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18320
pull_request: https://github.com/python/cpython/pull/18972

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +18319
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18971

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-12 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +Mark.Shannon, eric.snow
title: Move PyThreadState structure to the internal C API -> Make the 
PyThreadState structure opaque (move it to the internal C API)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com