Spyder: Error is displayed in the editor even after it has been fixed (Linux)

Created on 6 Apr 2020  路  15Comments  路  Source: spyder-ide/spyder

Hey everyone, thanks for all the hard work on Spyder 4.
When I introduce an error in my code (eg by assigning a variable to a non-existing variable) and fix it immediately, the original error message will not go away unless I restart the python language server.

This only occurs when I introduce the error in the middle of my scripts, but not at the beginning.

This GIF shows what I am talking about:
spyder_bug

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [x] Restarted Spyder

    • [ ] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [ ] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Pyflakes error message does not disappear after error in code is fixed.

Steps to reproduce

  1. Open medium-to-large script in spyder
  2. Go to somewhere in the middle
  3. Add faulty line that references a non-existing variable
  4. Fix faulty line

Notes on reproducibility:

  • occurred with several medium (~100 lines or more) to large scripts
  • failed to reproduce with simple mock code
  • failed to reproduce when introducing error in beginning of script (see GIF)

Versions

  • Spyder version: 4.1.2
  • Python version: 3.8.2
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Ubuntu 19.10

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.2 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.0.0 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  19.0.0 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.3 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  None (OK)
Linux Code Completion Awaiting Followup Bug

All 15 comments

Open medium-to-large script in spyder

This is not enough. Please share with us the script you are showing in your gif to see if we can reproduce this bug in our side.

Okay, I have prepared a repository with 2 exemplary files that are less complex than the one in the gif under https://github.com/basslerfish/exemplary_files_for_bug_in_spyder.

Steps to reproduce:

  1. Open main.py
  2. Change line 12 b=None to b=a.test() (or simply a. will suffice as well)
  3. Change line 12 to b=1 or some other valid code

The error message for line 12 does not disappear after these steps for me.
GIF:
spyder_bug2

Please let me know if this also occurs for you or just on my side - thank you!

Thanks a lot for your help!! We'll take a look at this soon.

I tried many, many ways to reproduce this and I couldn't.

@basslerfish, another way you can help us to debug this is by opening a terminal and starting Spyder with this command:

spyder --debug-info verbose --debug-output file

After doing that, a file called spyder-debug.log will be generated in the same directory where you ran that command. Please upload it here.

And before closing Spyder, please also go to the the menu Tools > LSP logs (which is only shown in debug mode):

Selecci贸n_002

click on the two entries shown on it to open those files in the editor, and upload their contents here too.

Thanks!

Thank you for investing so much time into this.
The error still occurs reliably for me.

I have placed the log files you asked for into the following folder of the same repository: exemplary_files_for_bug_in_spyder/logs/

If there is anything else I can do to help, please let me know!

Hi there,

I also get this problem a lot. It is hard to reproduce as it it quite random.
An example would be striating to type the name of a variable, in the middle of typing LSP would consider that the variable doesn't exist and then never updates.
Restarting it often does the trick.

@basslerfish, sorry for the delay in coming back to you. Could you upload an animated gif from the moment you type spyder in a terminal?

I think I know what the error is in your case but I want to verify it with your gif. Thanks!

Thanks for coming back to this one. Here's the GIF you requested:
spyder_bug_latest

FYI, I updated all my packages to the newest version (e.g. spyder 4.1.3, pyflakes 2.2.0, pylint 2.5.2) just before recording this GIF.

Thanks @basslerfish! Could you also post the output of conda list for your environment? Thanks!

No problem! Here's the list: conda_list.txt

@basslerfish, I have good news for you:

  • I could reproduce your error in 4.1.3, not exactly in the way you described it, but I still managed to get linting to die after a while.
  • We've done a lot of improvements to linting in the coming 4.1.4 and (after trying for a long time) I couldn't reproduce your error anymore.

So please wait until 4.1.4 is out and let us know if that fixes the problem for you or not.

By the way, 4.1.4 should be released by the end of the week.

@ccordoba12 Thank you very much for taking care of this, I'll make sure to check out 4.1.4!

Just wanted to say that the error does not occur anymore with 4.1.4. Thanks again for taking care of this!

@basslerfish, great news! Thanks for the confirmation!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Diti24 picture Diti24  路  47Comments

jdweaver picture jdweaver  路  77Comments

ckaldemeyer picture ckaldemeyer  路  48Comments

jeffak picture jeffak  路  115Comments

spyder-bot picture spyder-bot  路  75Comments