Issue 38113: Remove statics from ast.c - Python tracker

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
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: dino.viehland Nosy List: dino.viehland, eric.snow, lukasz.langa, miss-islington, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2019-09-11 14:05 by dino.viehland, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15957 merged dino.viehland, 2019-09-11 14:06
PR 15975 merged dino.viehland, 2019-09-11 15:02
PR 22258 merged pablogsal, 2020-09-15 18:07
Messages (9)
msg351888 - (view) Author: Dino Viehland (dino.viehland) * (Python committer) Date: 2019-09-11 14:05
Remove various static state from the ast module and make it PEP-384 compatible.  This will help make it be more compatible w/ subinterpreters and make it re-usable by 3rd party implementations.
msg351916 - (view) Author: Dino Viehland (dino.viehland) * (Python committer) Date: 2019-09-11 14:56
Remove statics to make more compatible with subinterpreters.
msg351952 - (view) Author: miss-islington (miss-islington) Date: 2019-09-11 15:47
New changeset 5b172c27f760dc5437e37dd8f1540eb76440e9a7 by Miss Islington (bot) (Dino Viehland) in branch 'master':
bpo-38113: Update Python/ast.c to PEP-384 (GH-15975)
https://github.com/python/cpython/commit/5b172c27f760dc5437e37dd8f1540eb76440e9a7
msg351987 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2019-09-11 17:16
New changeset ac46eb4ad6662cf6d771b20d8963658b2186c48c by Eric Snow (Dino Viehland) in branch 'master':
bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)
https://github.com/python/cpython/commit/ac46eb4ad6662cf6d771b20d8963658b2186c48c
msg352261 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-09-13 09:41
This change introduced tons of reference leaks, more than 21 test files leak references: see bpo-38152.

Please fix these leaks, or I will have to revert the change:
https://pythondev.readthedocs.io/ci.html#revert-on-fail
msg372927 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-07-03 12:27
> New changeset ac46eb4ad6662cf6d771b20d8963658b2186c48c by Eric Snow (Dino Viehland) in branch 'master':
> bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)

This change introduced a subtle regression: bpo-41194. I modified the _ast module to use again a global state:

New changeset 91e1bc18bd467a13bceb62e16fbc435b33381c82 by Victor Stinner in branch 'master':
bpo-41194: The _ast module cannot be loaded more than once (GH-21290)
https://github.com/python/cpython/commit/91e1bc18bd467a13bceb62e16fbc435b33381c82


I also proposed PR 21293 to use again a module state, even if the implementation has some drawbacks (see the PR comments).
msg375882 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-25 10:18
> This change introduced a subtle regression: bpo-41194. I modified the _ast module to use again a global state: (...)

Sadly, my fix doesn't work in all cases, there is yet another bug: bpo-41631 "_ast module: get_global_ast_state() doesn't work with Mercurial lazy import".
msg376945 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-09-15 16:03
New changeset e5fbe0cbd4be99ced5f000ad382208ad2a561c90 by Victor Stinner in branch 'master':
bpo-41631: _ast module uses again a global state (#21961)
https://github.com/python/cpython/commit/e5fbe0cbd4be99ced5f000ad382208ad2a561c90
msg376949 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-09-15 18:33
New changeset 55e0836849c14fb474e1ba7f37851e07660eea3c by Pablo Galindo in branch '3.9':
[3.9] bpo-41631: _ast module uses again a global state (GH-21961) (GH-22258)
https://github.com/python/cpython/commit/55e0836849c14fb474e1ba7f37851e07660eea3c