Skip to content

Lib/symbol.py is out of sync with Grammar/Grammar #68485

Closed

Description

@mgedmin
mannequin
BPO 24297
Nosy @mgedmin, @benjaminp, @bitdancer, @1st1
Files
  • test_symbol.patch
  • 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/1st1'
    closed_at = <Date 2015-05-28.18:06:48.316>
    created_at = <Date 2015-05-27.12:51:14.636>
    labels = ['library', 'release-blocker']
    title = 'Lib/symbol.py is out of sync with Grammar/Grammar'
    updated_at = <Date 2015-09-02.12:35:11.274>
    user = 'https://github.com/mgedmin'

    bugs.python.org fields:

    activity = <Date 2015-09-02.12:35:11.274>
    actor = 'python-dev'
    assignee = 'yselivanov'
    closed = True
    closed_date = <Date 2015-05-28.18:06:48.316>
    closer = 'yselivanov'
    components = ['Library (Lib)']
    creation = <Date 2015-05-27.12:51:14.636>
    creator = 'mgedmin'
    dependencies = []
    files = ['39519']
    hgrepos = []
    issue_num = 24297
    keywords = ['patch']
    message_count = 7.0
    messages = ['244160', '244168', '244174', '244177', '244334', '244335', '249540']
    nosy_count = 5.0
    nosy_names = ['mgedmin', 'benjamin.peterson', 'r.david.murray', 'python-dev', 'yselivanov']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue24297'
    versions = ['Python 3.5', 'Python 3.6']

    Activity

    1. mgedmin commented on May 27, 2015

      mgedminmannequin
      MannequinAuthor

      While investigating https://bitbucket.org/pypa/setuptools/issue/388/install-from-sdist-fails-on-python-350b1 I noticed that Grammar/Grammar changed in 3.5, but Lib/symbol.py wasn't updated.

      I'm not familiar with the CPython parser, but I suspect that adding/removing/splitting grammar rules causes the nonterminal symbol IDs to shift, which ought to require an update in symbol.py.

      Huh. Now I see a comment in the file says it is automatically generated, but in that case why wasn't that done when I did 'hg pull -u && make && make install'? Why is it checked into source control?

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on May 27, 2015
    3. bitdancer commented on May 27, 2015

      @bitdancer
      Member

      It is "automatically generated" in that it isn't hand-written. On the other hand, it isn't "automatically generated" in the sense of being part of the make process, ./python symbol.py is supposed to be run by hand when it is appropriate.

      A bit ago someone wrote tests for keyword.py that among other things made sure we didn't forget to update it when needed. Someone needs to write a similar test for symbol, it looks like.

      Whether or not one or both of these could be/should be incorporated into make (now that we have 'make touch' to deal with the consequences) is a separate question. As to why it is checked in, we check in almost all the build artifacts previous to the compile stage, so that there is no need to have an already-built python to build python from source.

    4. python-dev commented on May 27, 2015

      python-devmannequin
      Mannequin

      New changeset 843fe7e831a8 by Yury Selivanov in branch '3.5':
      bpo-24297: Update symbol.py. See also bpo-24017.
      https://hg.python.org/cpython/rev/843fe7e831a8

      New changeset 87509d71653b by Yury Selivanov in branch 'default':
      bpo-24297: Update symbol.py. See also bpo-24017.
      https://hg.python.org/cpython/rev/87509d71653b

    5. 1st1 commented on May 27, 2015

      @1st1
      Member

      Attached is a new unittest to make sure that symbol.py is always updated. Essentially it's the same test that we have for keywords.py. Please review.

    6. self-assigned this
      on May 27, 2015
    7. python-dev commented on May 28, 2015

      python-devmannequin
      Mannequin

      New changeset a95d0dd3c2b1 by Yury Selivanov in branch 'default':
      bpo-24297: Add a unittest that Lib/symbol.py is in sync with Grammar
      https://hg.python.org/cpython/rev/a95d0dd3c2b1

    8. 1st1 commented on May 28, 2015

      @1st1
      Member

      Marius, thanks for reporting the bug and review!

    9. python-dev commented on Sep 2, 2015

      python-devmannequin
      Mannequin

      New changeset bf7ef3bd9a09 by Victor Stinner in branch 'default':
      bpo-24297: Fix test_symbol on Windows
      https://hg.python.org/cpython/rev/bf7ef3bd9a09

    10. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    release-blockerstdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions