Sublime Forum

Python f''' '''' block string scoping bug


Hi. I was about to file an issue for this, but first wanted to double check it’s not me doing something stupid, e.g., having the wrong settings somewhere for my version of python. (I’m currently using 3.6.5 on my machine.)

Say I have the following python file:

f'''hello world'''

When I run view.scope_name(15) from the console I get back

'source.python meta.string.interpolated.python string.quoted.single.block.python punctuation.definition.string.begin.python '

but it should really be

'source.python meta.string.interpolated.python string.quoted.single.block.python punctuation.definition.string.end.python '

because character 15 is the first of the closing quotes.

This issue doesn’t arise with ordinary block quoted strings '''hello''' or even raw quoted strings r'''hello'''.

Could it be due to the fact that I haven’t correctly pointed Sublime to the be using a sufficiently advanced python version, or sth like that, or is it a bug?



it is a bug, but has already been fixed on master:



Oh wow thank you!



Thanks for the report. I submitted a fix at:

The PR @kingkeith referenced actually fixed a different issue.

1 Like