Had a "mobilenetv2.py" file. Renamed it via rightclick rename procedure. Typed new file name as "MobileNetV2.py". Spyder asks "do you want to rename and replace the file". Accepted --> Crash --> Send the bug--> Profit!
File "C:\Users\Tulpar\Anaconda3\lib\site-packages\spyder\plugins\editor\plugin.py", line 2108, in renamed
filename, to_text_string(dest))
File "C:\Users\Tulpar\Anaconda3\lib\site-packages\spyder\plugins\editor\utils\autosave.py", line 385, in file_renamed
old_hash = self.file_hashes[old_name]
KeyError: 'C:\\ferfiles\\mobilenetv2.py'
atomicwrites >=1.2.0 : 1.3.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.2.2 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.11.1 (OK)
jedi =0.14.1 : 0.14.1 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
pexpect >=4.4.0 : 4.7.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=0.3 : 5.6.7 (OK)
pygments >=2.0 : 2.5.2 (OK)
pylint >=0.25 : 2.4.4 (OK)
pyls >=0.31.2;<0.32.0 : 0.31.2 (OK)
zmq >=17 : 18.1.0 (OK)
qdarkstyle >=2.7 : 2.7 (OK)
qtawesome >=0.5.7 : 0.6.0 (OK)
qtconsole >=4.6.0 : 4.6.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.8.3 (OK)
sphinx >=0.6.6 : 2.3.1 (OK)
spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK)
watchdog : None (OK)
cython >=0.21 : 0.29.14 (OK)
matplotlib >=2.0.0 : 3.1.1 (OK)
numpy >=1.7 : 1.17.4 (OK)
pandas >=0.13.1 : 0.25.3 (OK)
scipy >=0.17.0 : 1.3.2 (OK)
sympy >=0.7.3 : 1.5 (OK)
I think file names on Windows are case insensitve, so there's no difference between mobilenetv2.py
and MobileNetV2.py
, and that's why the error appears.
@jitseniesen, could you take a look at this one?
I think file names on Windows are case insensitve, so there's no difference between
mobilenetv2.py
andMobileNetV2.py
, and that's why the error appears.
Well spotted!
@jitseniesen, could you take a look at this one?
Will do.
I am trying to understand the traceback, which led me to the File Explorer, in particular line 904-908:
I wonder whether the second line above should have path
instead of fname
, so that it reads
if osp.isfile(path):
After the rename_file
, the file fname
is renamed to path
, so we should call osp.file
on the new name.
Can somebody please check whether that makes sense? I am hesitant to touch code that I don't really understand, and there don't seem to be any adverse effects at the moment.
Can somebody please check whether that makes sense?
@goanpeca, please help @jitseniesen with that.
Will do!
File Explorer, in particular line 904-908
After looking at it in more depth, I am quite certain that those lines need to be changed because I discovered a user-visible bug which can be reproduced as follows:
foo
and foobar
(the important thing is that the first name is a prefix of the second name).foo
to ham
foo
is also renamed to ham
(as expected). However, the tab foobar
is erroneously renamed to hambar
(which leads the editor to complain that that file does not exist).I am preparing a PR to fix this. The fix makes the issue originally reported here much more prominent, so I will also include a fix for that.
Thanks @jitseniesen !
Most helpful comment
After looking at it in more depth, I am quite certain that those lines need to be changed because I discovered a user-visible bug which can be reproduced as follows:
foo
andfoobar
(the important thing is that the first name is a prefix of the second name).foo
toham
foo
is also renamed toham
(as expected). However, the tabfoobar
is erroneously renamed tohambar
(which leads the editor to complain that that file does not exist).I am preparing a PR to fix this. The fix makes the issue originally reported here much more prominent, so I will also include a fix for that.