homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Parser: broken line numbers for triple-quoted strings
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: col_offset is -1 and lineno is wrong for multiline string expressions
View: 16806
Assigned To: Nosy List: benjamin.peterson, serhiy.storchaka, skrah, vstinner
Priority: normal Keywords:

Created on 2015年07月12日 19:41 by skrah, last changed 2022年04月11日 14:58 by admin. This issue is now closed.

Messages (3)
msg246665 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2015年07月12日 19:41
IMO the string should start at lineno=1, col_offset=0.
$ ./python 
Python 3.6.0a0 (default:02b81a82a57d, Jul 12 2015, 20:33:44) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> a = ast.parse('''"""xxx
... yyy
... zzz"""''')
>>> ast.dump(a, include_attributes=True)
"Module(body=[Expr(value=Str(s='xxx\\nyyy\\nzzz', lineno=3, col_offset=-1), lineno=3, col_offset=-1)])"
msg254116 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2015年11月05日 16:41
Victor, I'm adding you just in case this also affects your
optimizer (like #25555).
msg254738 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015年11月16日 15:24
This is a duplicate of issue16806 
History
Date User Action Args
2022年04月11日 14:58:18adminsetgithub: 68811
2015年11月16日 15:24:15serhiy.storchakasetstatus: open -> closed

superseder: col_offset is -1 and lineno is wrong for multiline string expressions

nosy: + serhiy.storchaka
messages: + msg254738
resolution: duplicate
stage: resolved
2015年11月05日 16:41:30skrahsetnosy: + vstinner
2015年11月05日 16:41:20skrahsetmessages: + msg254116
2015年07月12日 19:42:12skrahsetnosy: + benjamin.peterson
2015年07月12日 19:41:18skrahcreate

AltStyle によって変換されたページ (->オリジナル) /