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

Parser: broken line numbers for triple-quoted strings #68811

Closed
skrah mannequin opened this issue Jul 12, 2015 · 3 comments
Closed

Parser: broken line numbers for triple-quoted strings #68811

skrah mannequin opened this issue Jul 12, 2015 · 3 comments

Comments

@skrah
Copy link
Mannequin

skrah mannequin commented Jul 12, 2015

BPO 24623
Nosy @vstinner, @benjaminp, @skrah, @serhiy-storchaka
Superseder
  • bpo-16806: col_offset is -1 and lineno is wrong for multiline string expressions
  • 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 2015-11-16.15:24:15.843>
    created_at = <Date 2015-07-12.19:41:18.818>
    labels = []
    title = 'Parser: broken line numbers for triple-quoted strings'
    updated_at = <Date 2015-11-16.15:24:15.841>
    user = 'https://github.com/skrah'

    bugs.python.org fields:

    activity = <Date 2015-11-16.15:24:15.841>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-11-16.15:24:15.843>
    closer = 'serhiy.storchaka'
    components = []
    creation = <Date 2015-07-12.19:41:18.818>
    creator = 'skrah'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 24623
    keywords = []
    message_count = 3.0
    messages = ['246665', '254116', '254738']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'benjamin.peterson', 'skrah', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '16806'
    type = None
    url = 'https://bugs.python.org/issue24623'
    versions = []

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Jul 12, 2015

    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)])"

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Nov 5, 2015

    Victor, I'm adding you just in case this also affects your
    optimizer (like bpo-25555).

    @serhiy-storchaka
    Copy link
    Member

    This is a duplicate of bpo-16806

    @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