Skip to content

symtable.symtable doesn't accept bytes which leads to a mismatch from compile() #81182

Closed

Description

@DinoV
BPO 37001
Nosy @DinoV
PRs
  • bpo-37001: Makes symtable.symtable have parity with compile for input #13483
  • 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/DinoV'
    closed_at = <Date 2019-05-28.23:22:09.353>
    created_at = <Date 2019-05-21.21:01:35.251>
    labels = ['3.8', 'library']
    title = "symtable.symtable doesn't accept bytes which leads to a mismatch from compile()"
    updated_at = <Date 2019-05-28.23:22:09.353>
    user = 'https://github.com/DinoV'

    bugs.python.org fields:

    activity = <Date 2019-05-28.23:22:09.353>
    actor = 'dino.viehland'
    assignee = 'dino.viehland'
    closed = True
    closed_date = <Date 2019-05-28.23:22:09.353>
    closer = 'dino.viehland'
    components = ['Library (Lib)']
    creation = <Date 2019-05-21.21:01:35.251>
    creator = 'dino.viehland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37001
    keywords = ['patch']
    message_count = 2.0
    messages = ['343096', '343829']
    nosy_count = 1.0
    nosy_names = ['dino.viehland']
    pr_nums = ['13483']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37001'
    versions = ['Python 3.8']

    Activity

    1. DinoV commented on May 21, 2019

      @DinoV
      ContributorAuthor

      symtable is useful when combined with compile() to AST to understand what the names bind to. But symtable.symtable() doesn't accept a bytes object, while compile does. Ultimately these feed down to the same API, and could easily lead to subtle mismatches due to encodings.

      The workaround seems to be to use the tokenize.detect_encoding to discover the encoding and then do the encoding from Python, but this seems wasteful.

    2. self-assigned this
      on May 21, 2019
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      on May 21, 2019
    4. DinoV commented on May 28, 2019

      @DinoV
      ContributorAuthor

      New changeset 4154069 by Dino Viehland in branch 'master':
      bpo-37001: Makes symtable.symtable have parity with compile for input (bpo-13483)
      4154069

    5. 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

    3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions