question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning is not displayed on the correct line for unknown variables in fstring

See original GitHub issue

Description of your problem

What steps will reproduce the problem? (I did not find an open issue about it but I may be wrong)

  1. Create a fstring with an unknown variable (see screenshot)
  2. There is a warning message about it but it is displayed on the first line of the script whichever line the issue is

image

What is the expected output? What do you see instead? The warning message should be in row 10 in the above screenshot

Versions and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.6
  • Qt Version: 5.6.2
  • PyQt Version: 5.6
  • Operating system: Windows 10

Dependencies

Please go to the menu entry Help > Optional Dependencies (or Help > Dependencies), press the button Copy to clipboard and paste the contents below:

IPython >=4.0 : 6.1.0 (OK) cython >=0.21 : 0.26.1 (OK) jedi >=0.9.0 : 0.10.2 (OK) nbconvert >=4.0 : 5.3.1 (OK) numpy >=1.7 : 1.13.1 (OK) pandas >=0.13.1 : 0.21.1 (OK) pycodestyle >=2.3: 2.3.1 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.2.0 (OK) pylint >=0.25 : 1.7.2 (OK) qtconsole >=4.2.0: 4.3.1 (OK) rope >=0.9.4 : 0.10.5 (OK) sphinx >=0.6.6 : 1.6.3 (OK) sympy >=0.7.3 : 1.1.1 (OK)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
csabellacommented, Jan 17, 2018

FYI, I believe this is the CPython issue this related to: https://bugs.python.org/issue30465

0reactions
Prikerscommented, Jan 4, 2018

Thanks @CAM-Gerlach. Indeed, I was considering the python version as the probable root cause. Updating python to 3.6.3 fixes the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - f-strings giving SyntaxError? - Stack Overflow
I think you have an old version of python. try upgrading to the latest version of python. F-string literals have been added to...
Read more >
implement support for PEP 498 (f-strings) : PY-18972
Enter search request. Visible to issue readers ... PY-20774 Unresolved reference for unknown variable inside a fstring should be an error not a...
Read more >
f-string-without-interpolation / W1309 - Pylint 2.16.0-dev ...
Description: Used when we detect an f-string that does not use any interpolation variables, in which case it can be either a normal...
Read more >
Invalid Syntax in Python: Common Reasons for SyntaxError
This means that the Python interpreter got to the end of a line (EOL) before an open string was closed. To fix this,...
Read more >
Python f-String Tutorial – String Formatting in ... - freeCodeCamp
When using f-Strings to display variables, you only need to specify the names of the variables inside a set of curly braces {}...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found