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.

KeyError when autosaving file

See original GitHub issue

Description

What steps will reproduce the problem?

It’s happened whole I guess it tried to save changes to the file.

Traceback

  File "/home/ravi/Anaconda/lib/python3.7/site-packages/spyder/plugins/editor/utils/autosave.py", line 122, in do_autosave
    stack.autosave.autosave_all()
  File "/home/ravi/Anaconda/lib/python3.7/site-packages/spyder/plugins/editor/utils/autosave.py", line 305, in autosave_all
    self.maybe_autosave(index)
  File "/home/ravi/Anaconda/lib/python3.7/site-packages/spyder/plugins/editor/utils/autosave.py", line 265, in maybe_autosave
    orig_hash = self.file_hashes[orig_filename]
KeyError: '/home/ravi/Documents/fj/tictac.py'
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}

Versions

  • Spyder version: 4.0.0b4
  • Python version: 3.7.3
  • Qt version: 5.12.4
  • PyQt5 version: 5.12.3
  • Operating System: Linux 5.2.4-1-MANJARO

Dependencies

pygments >=2.0    :  2.4.2 (OK)
qdarkstyle >=2.6.4:  2.7 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
psutil >=0.3      :  5.6.3 (OK)
pyls >=0.27.0     :  0.28.0 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
numpy >=1.7       :  1.16.4 (OK)
sympy >=0.7.3     :  1.4 (OK)
cython >=0.21     :  0.29.12 (OK)
qtconsole >=4.5.2 :  4.5.2 (OK)
IPython >=4.0     :  7.6.1 (OK)
matplotlib >=2.0.0:  3.1.0 (OK)
pylint >=0.25     :  2.3.1 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ravi4kcommented, Aug 21, 2019

Yes, but only in the internal file explorer.

0reactions
jitseniesencommented, Aug 21, 2019

I found one possible cause: if you rename a file in the file explorer, then it is automatically renamed in the editor, but the autosave information is not updated. This leads to the KeyError exception posted.

@DeadVampire Do you remember by any chance whether you renamed the file?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python KeyError During Save/Load - Stack Overflow
In your error: KeyError: b'flipvariables' means the key flipvariables does not exist for the given dictionary. Based on the line flipvariables ...
Read more >
RoboFont Forum UFO not saving all changes
Occasionally I've been able to salvage the changes glyphs from auto saved files but it's really frustrating and hard to keep track of....
Read more >
AutoSave error - Microsoft Community
I have recently installed Office 365 on my desktop. Now, when I download a Word document and try to 'save as' to the...
Read more >
Full Text Bug Listing - Red Hat Bugzilla
Description of problem: I thought I'd create a customized material profile. So I hit Ctrl+K (Settings > Extruder 1 > Material > Manage ......
Read more >
Python KeyError Exceptions and How to Handle Them
The program fails when you give a key that is not in the dictionary. Here, the traceback's last few lines point to the...
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