classification
Title: Incorrect col_offset for decorators with zero arguments (empty parentheses)
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8, Python 3.7, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alexmojaki, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2019-10-20 08:21 by alexmojaki, last changed 2019-10-26 15:44 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
decorator_python_bug.py alexmojaki, 2019-10-20 08:21
Pull Requests
URL Status Linked Edit
PR 16861 merged serhiy.storchaka, 2019-10-20 09:51
PR 16929 merged miss-islington, 2019-10-26 13:46
PR 16930 merged serhiy.storchaka, 2019-10-26 14:07
PR 16931 merged serhiy.storchaka, 2019-10-26 14:13
Messages (6)
msg354987 - (view) Author: Alex Hall (alexmojaki) Date: 2019-10-20 08:21
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)`).
msg354988 - (view) Author: Alex Hall (alexmojaki) Date: 2019-10-20 08:23
I assume this also happens on 3.9, it's just a bit hard for me to test that now.
msg355414 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-26 13:46
New changeset 26ae9f6d3d755734c9f371b9356325afe5764813 by Serhiy Storchaka in branch 'master':
bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
https://github.com/python/cpython/commit/26ae9f6d3d755734c9f371b9356325afe5764813
msg355415 - (view) Author: miss-islington (miss-islington) Date: 2019-10-26 14:06
New changeset ba3a566328e8df49741059b24a41480e248bf6d7 by Miss Skeleton (bot) in branch '3.8':
bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
https://github.com/python/cpython/commit/ba3a566328e8df49741059b24a41480e248bf6d7
msg355416 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-26 14:30
New changeset 91fc9cf43cc2e3a2f236ef9944cf1f4bed701545 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)
https://github.com/python/cpython/commit/91fc9cf43cc2e3a2f236ef9944cf1f4bed701545
msg355417 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-26 14:30
New changeset 493fef60a7600f83fe6916ed89d0fb0c0aab484d 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)
https://github.com/python/cpython/commit/493fef60a7600f83fe6916ed89d0fb0c0aab484d
History
Date User Action Args
2019-10-26 15:44:57serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-10-26 14:30:33serhiy.storchakasetmessages: + msg355417
2019-10-26 14:30:17serhiy.storchakasetmessages: + msg355416
2019-10-26 14:13:32serhiy.storchakasetpull_requests: + pull_request16460
2019-10-26 14:07:20serhiy.storchakasetpull_requests: + pull_request16459
2019-10-26 14:06:43miss-islingtonsetnosy: + miss-islington
messages: + msg355415
2019-10-26 13:46:34miss-islingtonsetpull_requests: + pull_request16458
2019-10-26 13:46:09serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg355414
2019-10-20 09:52:13serhiy.storchakasetversions: + Python 3.9, - Python 3.5, Python 3.6
2019-10-20 09:51:10serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request16407
2019-10-20 08:23:14alexmojakisetmessages: + msg354988
2019-10-20 08:21:37alexmojakicreate