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.

Author arminius
Recipients arminius, eric.smith
Date 2019-10-04.08:53:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570179206.67.0.660570991885.issue35212@roundup.psfhosted.org>
In-reply-to
Content
There is another instance of incorrectly reported offsets in f-strings, in this case affecting multi-line strings.

Example:

(
    f'aaa{foo}bbb'
    f'ccc{bar}ddd'
    f'eee{baz}fff'
)

Relevant part of the syntax tree:

JoinedStr(
    lineno=2,
    col_offset=4,
    values=[
        Str(lineno=2, col_offset=4, s='aaa'),
        FormattedValue(
            lineno=2,
            col_offset=4,
            value=Name(lineno=2, col_offset=10, id='foo', ctx=Load()),
            conversion=-1,
            format_spec=None,
        ),
        Str(lineno=2, col_offset=4, s='bbbccc'),
        FormattedValue(
            lineno=2,
            col_offset=4,
            value=Name(lineno=2, col_offset=5, id='bar', ctx=Load()),
            conversion=-1,
            format_spec=None,
        ),
        Str(lineno=2, col_offset=4, s='dddcccaaaaaaaaaaaaaa'),
        FormattedValue(
            lineno=2,
            col_offset=4,
            value=Name(lineno=2, col_offset=5, id='baz', ctx=Load()),
            conversion=-1,
            format_spec=None,
        ),
        Str(lineno=2, col_offset=4, s='ddd'),
    ],
),

The reported code position for "foo" is correct (2,10), but not for "bar" (2,5) and "baz" (2,5).


Could you give an estimate as to whether this issue will be looked at any time soon?
History
Date User Action Args
2019-10-04 08:53:26arminiussetrecipients: + arminius, eric.smith
2019-10-04 08:53:26arminiussetmessageid: <1570179206.67.0.660570991885.issue35212@roundup.psfhosted.org>
2019-10-04 08:53:26arminiuslinkissue35212 messages
2019-10-04 08:53:26arminiuscreate