Spyder: Atomic writes generate temp files in Dropbox

Created on 16 Jun 2020  路  16Comments  路  Source: spyder-ide/spyder

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)
  • [ x] Tried basic troubleshooting (if a bug/error)

    • [x ] Restarted Spyder

    • [ x] Reset preferences with spyder --reset

    • [ x] Reinstalled the latest version of Anaconda

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

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

Problem Description

Spyder4 changes the auto-save recovery file location to the last directory a script was opened from or saved to. Un-selecting the auto-save feature and restarting Spyder does not disable the auto-save file creation.

What steps reproduce the problem?

  1. Reset Spyder Settings
  2. Disable autosave, restart Spyder
  3. Open a previously saved script -- example.py, from directory "usr/pyscript/"
  4. Run the script, and find a list of "File" saved under the diretory "usr/pyscript/", where "File" are the different auto-save versions of example.py
  5. When ceating a new script, the default "save as" directory is also "usr/pyscript/"

What is the expected output? What do you see instead?

The autosave feature can be disabled correctly, or the autosave file to be saved in a specified directory.

Versions

  • Spyder version: 4.1.3
  • Python version: 3.7
  • Qt version:
  • PyQt version:
  • Operating System name/version:
Editor Bug

Most helpful comment

sure! I'll try that :)

And I'll also test it with other clients, such as NextCloud or OneDrive, as I would suspect that they could produce problems as well, however, as they are not so wide-spread it might not have been reported yet.

All 16 comments

A new auto-save file pops up immediately after running any unsaved script with runcell (ctrl + enter).

By unchecking "save all files before running script" in the preferences, no new auto-save files are created at the time of running the cell. HOWEVER, new auto-save files are created in "usr/pyscript/" immediately when I manually save the changes to "example.py".

Hi @rqli9,

Can you please send us a gif or screenshots of the behavior that you are having right now?

Hi @steff456

I attached the screenshot of the auto-save files, which are variations of the versions of the highlighted ".py" file that I was actively working on and saved in the same folder. The "auto-save" feature was unselected before all these files were created. It seems to me that these files are the auto-saves for recovery purposes created by spyder.

pyspyder

Spyder autosaves files in the configuration directory, so those files were not created by the program. Can you please delete all the temp files in the directory and verify if they are created once you open the NLTK_exercise.py in Spyder?

As well I can see in your screenshot that you are using Dropbox, so maybe that is the cause of all those temp files.

Hello @steff456,

(1) I have manually checked all of these files. They contain incremental versions of NLTK_exercise.py

(2) After deleting all of the existing files, new files are added to the directory once I begin editing and running code in NLTK_exercise.py.

(3) I have been using Spyder3 in the same directory for an extended amount of time without issue. This problem disappears after reverting back to a Spyder3 installation and opening the NLTK_exercise.py file in the same directory. After going back to Spyder4, the problem appears again.

It seems there's a conflict with the combination of the auto-save function with dropbox. For now, please work with your files outside dropbox while we work on fixing this.

Thanks for reporting!

@dalthviz can you please take a look on this one?

@steff456

Thank you for working on this issue. I hope it will get fixed soon.

@dalthviz, I think this is related to the way we perform atomic writes and how Dropbox saves (somehow) those temporary files we use in the background.

I do confirm I have this annoying issue as well, are there any ways of preventing these files from being saved (I cannot avoid working in dropbox)?

Hey @DominiqueMakowski, there are no ways to avoid this problem right now, sorry.

I'm still affected by this issue, is this already being worked on?

I think this could be circumvented by not storing the tempfiles in the same directory (as long as it's on the same partition, this should be fine, right?), but in the tempfolder? or is there a reason why this is not done?

Hi @skjerns I think the idea you have is the right one :+1: In fact, I think is possible to change the dir where atomic-writes stores the temporary files by passing the dir kwarg (which is used in Atomic Writes to hold the temp files) with the path to the temp directory/a temp directory object here:

https://github.com/spyder-ide/spyder/blob/187c56a4909c7c5167f2c8a051033cd199bfa4c5/spyder/utils/encoding.py#L267-L268

I haven had time to work on a fix for this but maybe you want to try to implement the fix @skjerns ? Let us know :)

Good thinking @dalthviz! However, I would say that we should do that only if the directory you're trying to save to contains Dropbox in it. That's because it's the only directory our users have reported it gives problems with our atomic saving.

sure! I'll try that :)

And I'll also test it with other clients, such as NextCloud or OneDrive, as I would suspect that they could produce problems as well, however, as they are not so wide-spread it might not have been reported yet.

Thanks @skjerns !

Great! Thanks for your help @skjerns!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marianux picture marianux  路  3Comments

spyder-bot picture spyder-bot  路  3Comments

JesterEE picture JesterEE  路  3Comments

ok97465 picture ok97465  路  3Comments

hgijeon picture hgijeon  路  3Comments