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: Regenerating parser table fails (windows)
Type: Stage: resolved
Components: Windows Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: constantmarks, gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-07-21 17:09 by constantmarks, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg374074 - (view) Author: Constant Marks (constantmarks) Date: 2020-07-21 17:09
When calling `build.bat -d --regen' the graminit.c and graminit.h files are not generated with the following warnings:

Time Elapsed 00:02:49.06
  Killing any running python_d.exe instances...
  Getting build info from "C:\Program Files\Git\cmd\git.exe"
  Building heads/3.9-dirty:9e84a2c424 3.9
  pythoncore.vcxproj -> C:\Users\crm0376\source\repos\cpython\PCbuild\win32\python39_d.dll
  C:\Users\crm0376\source\repos\cpython\Parser\pgen\__main__.py:43: ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Users\\crm0376\\source\\repos\\cpython\\PCbuild\\obj\\39win32_Debug\\regen\\graminit.h' mode='w' encoding='cp
  1252'>
    main()
  ResourceWarning: Enable tracemalloc to get the object allocation traceback
  C:\Users\crm0376\source\repos\cpython\Parser\pgen\__main__.py:43: ResourceWarning: unclosed file <_io.TextIOWrapper name='C:\\Users\\crm0376\\source\\repos\\cpython\\PCbuild\\obj\\39win32_Debug\\regen\\graminit.c' mode='w' encoding='cp
  1252'>
    main()
  ResourceWarning: Enable tracemalloc to get the object allocation traceback
msg374201 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-07-24 18:32
Is this really worth our attention? In 3.10 this will be irrelevant.
msg374256 - (view) Author: Constant Marks (constantmarks) Date: 2020-07-25 12:27
Maybe I am doing something wrong.  I fetched the 3.10 alpha release, made a simple edit to line 93 in Grammer. 

pass_stmt: 'pass' | 'proceed'

Ran: 
>build.bat -d --regen

Successfully compiles with:
warning : Pegen updated. You will need to rebuild pythoncore to see the changes.

So I run:
> build.bat -d

But after all this I still get the runtime Name error that 'proceed' is not defined.

I have tried build.bat -t:cCleanAll bit it still does not work.  

Are there some extra steps with the new PEG parser?
msg374281 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-07-25 21:22
Sorry, I realize what's wrong here. When we switched to the new PEG parser (the "pegen" you saw mentioned in the warning) we switched to a new grammar file. You have to change Grammar/python.gram instead of Grammar/Grammar.

We couldn't get rid of the Grammar/Grammar file yet because it's mentioned in the docs; this is pending a better way of producing https://docs.python.org/3.10/reference/grammar.html.

I hope this has informed you sufficiently; I don't think there's a bug that needs to be fixed on our end.
msg374299 - (view) Author: Constant Marks (constantmarks) Date: 2020-07-26 01:39
Thanks. I will check it out when I get back in front of my computer.

On Sat, Jul 25, 2020 at 4:22 PM Guido van Rossum <report@bugs.python.org>
wrote:

>
> Guido van Rossum <guido@python.org> added the comment:
>
> Sorry, I realize what's wrong here. When we switched to the new PEG parser
> (the "pegen" you saw mentioned in the warning) we switched to a new grammar
> file. You have to change Grammar/python.gram instead of Grammar/Grammar.
>
> We couldn't get rid of the Grammar/Grammar file yet because it's mentioned
> in the docs; this is pending a better way of producing
> https://docs.python.org/3.10/reference/grammar.html.
>
> I hope this has informed you sufficiently; I don't think there's a bug
> that needs to be fixed on our end.
>
> ----------
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue41362>
> _______________________________________
>
msg374408 - (view) Author: Constant Marks (constantmarks) Date: 2020-07-27 18:03
Thanks for the help.  I got my modification working by modifying the python.gram file and running build.bat --regen.
History
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85534
2020-07-27 18:03:53constantmarkssetmessages: + msg374408
2020-07-26 01:39:05constantmarkssetmessages: + msg374299
2020-07-25 21:22:55gvanrossumsetstatus: open -> closed
resolution: not a bug
messages: + msg374281

stage: resolved
2020-07-25 12:27:07constantmarkssetmessages: + msg374256
2020-07-24 18:32:14gvanrossumsetnosy: + gvanrossum
messages: + msg374201
2020-07-21 17:21:41xtreaksetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows
2020-07-21 17:09:20constantmarkscreate