You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The elements in Grammar/python.gram stripped by peg_lexer.py still shows in generated PO files #142714
However, the content after START OF INVALID RULES is missing on the page
snapshot
I checked the previous version and found out the doc has this issue since 3.11 (after PEG parser is introduced).
Other info:
I translated this page into Traditional Chinese (zh-tw) recently and somehow it shows correctly on the translated page
snapshot
So here's the revised issue description:
Some elements in Grammar/python.gram are stripped by peg_lexer.py, and hence they're hidden on the reference/grammar docs. However, the full content of Grammar/python.gram is still remained in the generated PO files (e.g. the one in zh-tw).
changed the title [-]"INVALID RULES" part in `reference/grammar` page is missing after rendered[/-][+]The elements in `Grammar/python.gram` stripped by `peg_lexer.py` still shows in generated PO files[/+]on Dec 14, 2025
Activity
StanFromIreland commentedon Dec 14, 2025
This is intentional, as the introduction states:
cpython/Doc/tools/extensions/lexers/peg_lexer.py
Lines 8 to 16 in e4d3c83
Why this is not done for translations is a bug.
mattwang44 commentedon Dec 14, 2025
ok thanks! I'll revise the issue description in-place then.
[-]"INVALID RULES" part in `reference/grammar` page is missing after rendered[/-][+]The elements in `Grammar/python.gram` stripped by `peg_lexer.py` still shows in generated PO files[/+]pythongh-142714: Strip hidden parts of the PEG grammar in all builders
Merge branch 'main' into pythongh-142714-peg-untranslatable
gh-142714: Exclude stripped PEG grammar text from translation catalogs (
[3.15] gh-142714: Exclude stripped PEG grammar text from translation …
[3.14] gh-142714: Exclude stripped PEG grammar text from translation …