Problem with `editor.set_file_contents` not overwriting an existing Dropbox file
peterh86 last edited by
Is this me, or a bug? Does anyone know a workaround?
Here's some code I run from the Python scratchpad:
import editor name = 'test.txt' text = 'hello world' root = 'dropbox' # 'local' or 'dropbox' editor.set_file_contents(name, text, root) editor.set_file_contents(name, text, root)
editor.set_file_contentsis meant to overwrite the file if it exists. Here's what I do:
- In Settings, reset Dropbox Sync.
- Run the code once. It works correctly and creates one file in Dropbox. I can see it in the Dropbox app and in Editorial's file browser.
- Wait 30 seconds and run the code again. Two problems: (a) The Dropbox app shows there is now a file test(1).txt as well as test.txt and (b) Editorial's file browser shows test(1).txt, but not test.txt.
- Running the code more creates more files, like test(2).txt.
And I found:
- Resetting Dropbox Sync makes Editorial's file browser match the Dropbox app browser.
- In the above code, if I set the root to 'local' it works properly.
- The action Set file contents works properly, and always overwrites the Dropbox file if it exists.