Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DinoV opened this issue May 21, 2019 · 2 comments
Closed
Assignees
Labels
3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@DinoV
Copy link
Contributor

DinoV commented May 21, 2019

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']

    @DinoV
    Copy link
    Contributor Author

    DinoV commented May 21, 2019

    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.

    @DinoV DinoV added the 3.8 only security fixes label May 21, 2019
    @DinoV DinoV self-assigned this May 21, 2019
    @DinoV DinoV added the stdlib Python modules in the Lib dir label May 21, 2019
    @DinoV
    Copy link
    Contributor Author

    DinoV commented May 28, 2019

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

    @DinoV DinoV closed this as completed May 28, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant