spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Renaming folder gave error #15386

Open semvijverberg opened 3 years ago

semvijverberg commented 3 years ago

Description

What steps will reproduce the problem?

I renamed a folder while python files (within that folder) were opened.

Traceback

  File "/Users/semvijverberg/miniconda3/envs/RGCPD/lib/python3.7/site-packages/spyder/plugins/editor/plugin.py", line 2241, in renamed_tree
    self.renamed(source=fname, dest=new_filename)
  File "/Users/semvijverberg/miniconda3/envs/RGCPD/lib/python3.7/site-packages/spyder/plugins/editor/plugin.py", line 2230, in renamed
    new_filename=to_text_string(dest))
  File "/Users/semvijverberg/miniconda3/envs/RGCPD/lib/python3.7/site-packages/spyder/plugins/editor/widgets/editor.py", line 1550, in rename_in_data
    self.set_current_filename(current_fname)
  File "/Users/semvijverberg/miniconda3/envs/RGCPD/lib/python3.7/site-packages/spyder/plugins/editor/widgets/editor.py", line 1699, in set_current_filename
    editor = self.data[index].editor
IndexError: list index out of range
ERROR:spyder.plugins.editor.utils.autosave:KeyError when retrieving hash of /Users/semvijverberg/surfdrive/Scripts/RGCPD/publications/NPJ_2021/clusters_check.py
ERROR:spyder.plugins.editor.utils.autosave:KeyError when retrieving hash of /Users/semvijverberg/surfdrive/Scripts/RGCPD/publications/NPJ_2021/clusters_check.py

Versions

Dependencies


# Mandatory:
applaunchservices >=0.1.7       :  0.2.1 (OK)
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  4.0.0 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.0.2 (OK)
IPython >=7.6.0                 :  7.20.0 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  22.0.1 (OK)
nbconvert >=4.0                 :  6.0.7 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.8.0 (OK)
pygments >=2.0                  :  2.8.0 (OK)
pylint >=1.0                    :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.3.0             :  0.3.2 (OK)
qdarkstyle >=2.8                :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.2 (OK)
qtconsole >=5.0.1               :  5.0.2 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
rtree >=0.8.3                   :  0.9.7 (OK)
setuptools >=39.0.0             :  49.6.0.post20210108 (OK)
sphinx >=0.6.6                  :  3.5.1 (OK)
spyder_kernels >=1.10.1;<1.11.0 :  1.10.1 (OK)
textdistance >=4.2.0            :  4.2.1 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3               :  2.0.1 (OK)
zmq >=17                        :  22.0.3 (OK)

# Optional:
cython >=0.21                   :  None (NOK)
matplotlib >=2.0.0              :  3.3.4 (OK)
numpy >=1.7                     :  1.20.1 (OK)
pandas >=1.1.1                  :  1.2.2 (OK)
scipy >=0.17.0                  :  1.6.0 (OK)
sympy >=0.7.3                   :  None (NOK)
dalthviz commented 3 years ago

Hi @semvijverberg thanks for the feedback! I was able to reproduce this if I change a folder name while having a project open. We will try to resolve this in a future release :+1: