Repository navigation
Remove the old parser #85111
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/pablogsal'
closed_at = <Date 2020-12-02.05:17:21.232>
created_at = <Date 2020-06-10.11:25:17.640>
labels = ['interpreter-core', '3.10']
title = 'Remove the old parser'
updated_at = <Date 2021-06-28.09:36:20.843>
user = 'https://github.com/pablogsal'bugs.python.org fields:
activity = <Date 2021-06-28.09:36:20.843>
actor = 'petr.viktorin'
assignee = 'pablogsal'
closed = True
closed_date = <Date 2020-12-02.05:17:21.232>
closer = 'pablogsal'
components = ['Interpreter Core']
creation = <Date 2020-06-10.11:25:17.640>
creator = 'pablogsal'
dependencies = []
files = ['49642', '49647']
hgrepos = []
issue_num = 40939
keywords = ['patch']
message_count = 69.0
messages = ['371182', '371264', '371265', '371266', '371267', '371268', '371270', '371271', '371288', '371289', '371290', '371291', '371292', '371301', '371307', '371308', '371310', '371311', '371316', '371327', '371929', '371940', '371942', '371953', '371977', '372023', '372025', '372026', '372027', '372370', '374282', '374346', '374410', '374413', '374416', '374417', '377083', '380826', '380828', '380855', '380863', '381095', '381103', '381112', '381136', '381137', '381140', '381172', '381176', '381182', '381227', '381232', '382129', '382130', '382134', '382285', '382287', '382289', '382293', '382299', '382323', '382324', '382325', '382329', '382337', '387017', '396348', '396488', '396622']
nosy_count = 12.0
nosy_names = ['gvanrossum', 'terry.reedy', 'vstinner', 'ned.deily', 'petr.viktorin', 'nnemkin', 'Igor.Skochinsky', 'hroncok', 'lys.nikolaou', 'pablogsal', 'miss-islington', 'brandtbucher']
pr_nums = ['20768', '20800', '20801', '20802', '20814', '20815', '20822', '21005', '21012', '21016', '21025', '21036', '21152', '21624', '19969', '21641', '21642', '22294', '23321', '23606', '26855', '26898']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue40939'
versions = ['Python 3.10']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Activity
pablogsal commentedon Jun 10, 2020
As stated in PEP-617, the old parser will be removed in Python 3.10
pablogsal commentedon Jun 11, 2020
New changeset 9727694 by Lysandros Nikolaou in branch 'master':
bpo-40939: Generate keyword.py using the new parser (GH-20800)
9727694
vstinner commentedon Jun 11, 2020
>>> __new_parser__ File "<stdin>", line 1 __new_parser__ ^ SyntaxError: You found it!"new", "ex" or "ng" are not really future proof names. Can we rename the keyword to "__peg_parser__"?
lysnikolaou commentedon Jun 11, 2020
I guess we could just remove this, as soon as the old parser is out. We were only using this to differentiate between the two parsers, when we were testing enabling/disabling the old one. I could get a PR ready to be merged after #64967 is there.
pablogsal commentedon Jun 11, 2020
I would personally would like to keep the easter egg, but I assume is better to rename it to "__peg_parser__".
miss-islington commentedon Jun 11, 2020
New changeset 961edf7 by Miss Islington (bot) in branch '3.9':
bpo-40939: Generate keyword.py using the new parser (GH-20800)
961edf7
lysnikolaou commentedon Jun 11, 2020
Ok then! On it.
vstinner commentedon Jun 11, 2020
I did'nt ask to remove the easter egg. I'm just asking to avoid the "new" name. In my experience, each time that a "new" thing happens, later we have to use "new extended", "new_v2" or worse name :-)
Oh, if the name changes, please change it in 3.9 as well.
Look at this amazing names of the 5 flavors of functions parsing a string:
Same for parsing a file:
Or PyRun functions:
ceval.c:
I cannot count the number of "Ex" functions that we have :-)
Py_Finalize() -> :Py_FinalizeEx() <= public!
PyErr_Print() -> PyErr_PrintEx() <= public!
PySys_SetArgv() -> PySys_SetArgvEx() <= public!
PyErr_WarnEx() <= public!
gvanrossum commentedon Jun 11, 2020
Honestly I see no reason to keep that easter egg. Can we remove it please?
52 remaining items
pablogsal commentedon Dec 2, 2020
Seems that commit 1ed83ad was deleting some functions that were not correctly covered by redirection macros. I have opened PR 23606 to restore those as they were.
pablogsal commentedon Dec 2, 2020
New changeset 46bd5ed by Pablo Galindo in branch 'master':
bpo-40939: Restore some stable API functions incorrectly deleted (GH-23606)
46bd5ed
IgorSkochinsky commentedon Dec 2, 2020
Thanks for the fix! I'd like to submit a test to avoid this and similar issues in future. Are there any guidelines for this? Sorry if this is a wrong place to ask.
pablogsal commentedon Dec 2, 2020
I am currently working on test that checks that the stable API symbols are correctly exported. Unfortunately there is no official maintained list if those symbols, so is taking a while
IgorSkochinsky commentedon Dec 2, 2020
Thank you very much! For added motivation, the 3.8.0 release was unusable thanks to bpo-37633 which was somewhat similar (also in pythonrun). For reference, I've attached a list of symbols we currently use (a few more we have to import dynamically since they're not in the stable ABI but we'd like to keep that list as short as possible).
nnemkin commentedon Dec 2, 2020
On Windows there is PC/python3dll.c.
pablogsal commentedon Dec 2, 2020
Even that is severely out of date, unfortunately. There are many functions that were removed in 3.8 and 3.7 that are still listed there.
pablogsal commentedon Dec 2, 2020
Opened https://bugs.python.org/issue42545 for that
vstinner commentedon Feb 15, 2021
FYI the unbound project was fixed by calling Py_CompileString() on Python 3.9 and newer:
NLnetLabs/unbound@e0d426e
encukou commentedon Jun 22, 2021
The removed functions are still listed in the documentation; this is confusing.
struct _nodeis not very usable in the C API, but what I saw in mod_wsgi was giving gave PyParser_* output to PyNode_Compile. I tried to write porting notes for this usage. It should also help with the "compile to check for syntax errors" case in unbound.encukou commentedon Jun 24, 2021
New changeset 29987f7 by Petr Viktorin in branch 'main':
bpo-40939: Remove documentation for
PyParser_*& add porting notes (GH-26855)29987f7
encukou commentedon Jun 28, 2021
New changeset dc10264 by Miss Islington (bot) in branch '3.10':
bpo-40939: Remove documentation for
PyParser_*& add porting notes (GH-26855) (GH-26898)dc10264