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

Incorrect col_offset for decorators with zero arguments (empty parentheses) #82716

Closed
alexmojaki mannequin opened this issue Oct 20, 2019 · 6 comments
Closed

Incorrect col_offset for decorators with zero arguments (empty parentheses) #82716

alexmojaki mannequin opened this issue Oct 20, 2019 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@alexmojaki
Copy link
Mannequin

alexmojaki mannequin commented Oct 20, 2019

BPO 38535
Nosy @serhiy-storchaka, @miss-islington, @alexmojaki
PRs
  • bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. #16861
  • [3.8] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861) #16929
  • [3.7] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861). #16930
  • [2.7] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861). #16931
  • Files
  • decorator_python_bug.py
  • 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 = None
    closed_at = <Date 2019-10-26.15:44:57.173>
    created_at = <Date 2019-10-20.08:21:37.752>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7', '3.9']
    title = 'Incorrect col_offset for decorators with zero arguments (empty parentheses)'
    updated_at = <Date 2019-10-26.15:44:57.172>
    user = 'https://github.com/alexmojaki'

    bugs.python.org fields:

    activity = <Date 2019-10-26.15:44:57.172>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-26.15:44:57.173>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-10-20.08:21:37.752>
    creator = 'alexmojaki'
    dependencies = []
    files = ['48669']
    hgrepos = []
    issue_num = 38535
    keywords = ['patch']
    message_count = 6.0
    messages = ['354987', '354988', '355414', '355415', '355416', '355417']
    nosy_count = 3.0
    nosy_names = ['serhiy.storchaka', 'miss-islington', 'alexmojaki']
    pr_nums = ['16861', '16929', '16930', '16931']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38535'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8', 'Python 3.9']

    @alexmojaki
    Copy link
    Mannequin Author

    alexmojaki mannequin commented Oct 20, 2019

    In a decorator such as @a(), the ast.Call node has a col_offset starting from the @ symbol. This doesn't happen for decorators without arguments (e.g. @a) or with some arguments (e.g. @a(x)).

    @alexmojaki alexmojaki mannequin added 3.8 only security fixes 3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Oct 20, 2019
    @alexmojaki
    Copy link
    Mannequin Author

    alexmojaki mannequin commented Oct 20, 2019

    I assume this also happens on 3.9, it's just a bit hard for me to test that now.

    @serhiy-storchaka serhiy-storchaka added the 3.9 only security fixes label Oct 20, 2019
    @serhiy-storchaka
    Copy link
    Member

    New changeset 26ae9f6 by Serhiy Storchaka in branch 'master':
    bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
    26ae9f6

    @miss-islington
    Copy link
    Contributor

    New changeset ba3a566 by Miss Skeleton (bot) in branch '3.8':
    bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
    ba3a566

    @serhiy-storchaka
    Copy link
    Member

    New changeset 91fc9cf by Serhiy Storchaka in branch '3.7':
    [3.7] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861). (GH-16930)
    91fc9cf

    @serhiy-storchaka
    Copy link
    Member

    New changeset 493fef6 by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861). (GH-16931)
    493fef6

    @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.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants