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

compiler: does not revert back the end_* locations #88229

Closed
isidentical opened this issue May 6, 2021 · 2 comments
Closed

compiler: does not revert back the end_* locations #88229

isidentical opened this issue May 6, 2021 · 2 comments

Comments

@isidentical
Copy link
Sponsor Member

BPO 44063
Nosy @miss-islington, @isidentical
PRs
  • bpo-44063: set the missing end locations on the compiler #25956
  • [3.10] bpo-44063: set the missing end locations on the compiler (GH-25956) #25972
  • 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 2021-05-07.20:40:57.096>
    created_at = <Date 2021-05-06.19:34:13.826>
    labels = []
    title = 'compiler: does not revert back the end_* locations'
    updated_at = <Date 2021-05-07.20:40:57.096>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2021-05-07.20:40:57.096>
    actor = 'BTaskaya'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-05-07.20:40:57.096>
    closer = 'BTaskaya'
    components = []
    creation = <Date 2021-05-06.19:34:13.826>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44063
    keywords = ['patch']
    message_count = 2.0
    messages = ['393138', '393221']
    nosy_count = 2.0
    nosy_names = ['miss-islington', 'BTaskaya']
    pr_nums = ['25956', '25972']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44063'
    versions = []

    @isidentical
    Copy link
    Sponsor Member Author

    Something that I've stumbled up while working on another patch is that, the compiler doesn't revert the end_lineno and the end_col_offset attributes back unlike regular lineno/col_offset. An example of this problem;
    ar rcs libpython3.10d.a Modules/getbuildinfo.o Parser/token.o Parser/pegen.o Parser/parser.o Parser/string_parser.o Parser/peg_api.(.venv38) (Python 3.8.5+) [ 10:33ÖS ] [ isidentical@desktop:~/cpython/cpython(main✔) ]
    $ cat t3.py
    def foo(a):
    pass

    foo(
        a=1,
        a=2
    )
     $ ./python t3.py
      File "/home/isidentical/cpython/cpython/t3.py", line 4
        foo(
            ^
    SyntaxError: keyword argument repeated: a

    with the fix

     $ ./python t3.py
      File "/home/isidentical/cpython/cpython/t3.py", line 6
        a=2
        ^^^
    SyntaxError: keyword argument repeated: a

    @isidentical
    Copy link
    Sponsor Member Author

    New changeset 13de28f by Miss Islington (bot) in branch '3.10':
    bpo-44063: set the missing end locations on the compiler (GH-25956) (bpo-25972)
    13de28f

    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant