Open dufengit opened 6 years ago
Thanks for reporting. Not sure we've seen this specific problem before, but we'll probably need more information about the circumstances in which this error occurred in order to fix it—was this the first time you tried saving a file? Does it only occur saving a particular file, or in a particular location? Did you try restarting Spyder, or saving somewhere else? Anything special about your system or environment?
Please describe step by step how you got this error so we can reproduce it in our side. If we don't hear from you, we'll have to close this issue in a week from now.
In the meantime, if you're still having this issue, you can try spyder --reset
from the Anaconda prompt and restarting Spyder to hopefully fix it. Best of luck!
Closed due to lack of response, sorry. If you do end up seeing this and have more to add isolating the problem, then feel free to reopen. Thanks.
Re-opened to serve as the canonical reference for this issue, per discussion in #7045
For the record, I got a similar thought not identical error when doing the "close all to right" command when one of the documents have not been saved and one had been removed externally in the system file manager. Unsure if reproducible at the moment:
File "C:\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 1470, in close_all_but_this
self.close_all_right()
File "C:\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 1466, in close_all_right
self.close_file(num+1)
File "C:\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 1416, in close_file
is_ok = force or self.save_if_changed(cancelable=True, index=index)
File "C:\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 1514, in save_if_changed
if self.data[index].editor.document().isModified():
IndexError: list index out of range
I was unable to reproduce this, sorry.
Description
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Please provide any additional information below
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor.py", line 2392, in run_file self.re_run_file() File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor.py", line 2412, in re_run_file self.save_all() File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor.py", line 2000, in save_all self.get_current_editorstack().save_all() File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 1689, in save_all if self.data[index].editor.document().isModified(): IndexError: list index out of range
Version and main components
Dependencies