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
Title: Remove statics from ast.c
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.9
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
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82294
2020-09-15 18:33:06lukasz.langasetmessages: + msg376949
2020-09-15 18:07:55pablogsalsetnosy: + pablogsal

pull_requests: + pull_request21314
2020-09-15 16:03:40lukasz.langasetnosy: + lukasz.langa
messages: + msg376945
2020-08-25 10:18:46vstinnersetmessages: + msg375882
2020-07-03 12:27:53vstinnersetmessages: + msg372927
2019-09-13 09:41:14vstinnersetnosy: + vstinner
messages: + msg352261
2019-09-11 17:18:00eric.snowsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-11 17:16:37eric.snowsetmessages: + msg351987
2019-09-11 15:47:19miss-islingtonsetnosy: + miss-islington
messages: + msg351952
2019-09-11 15:02:52dino.viehlandsetpull_requests: + pull_request15608
2019-09-11 14:56:19dino.viehlandsetmessages: + msg351916
components: + Interpreter Core, - Extension Modules
title: Make ast module PEP-384 compatible -> Remove statics from ast.c
2019-09-11 14:07:17dino.viehlandsetnosy: + eric.snow
2019-09-11 14:06:52dino.viehlandsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15592
2019-09-11 14:05:11dino.viehlandcreate