We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fabca3 commit e99ce8cCopy full SHA for e99ce8c
example/back-up-and-restore/backup-and-restore-example.py
@@ -18,7 +18,7 @@
18
19
# Uploads contents of LOCALFILE to Dropbox
20
def backup():
21
- with open(LOCALFILE, 'r') as f:
+ with open(LOCALFILE, 'rb') as f:
22
# We use WriteMode=overwrite to make sure that the settings in the file
23
# are changed on upload
24
print("Uploading " + LOCALFILE + " to Dropbox as " + BACKUPPATH + "...")
@@ -41,7 +41,7 @@ def backup():
41
# @param new_content is a string
42
def change_local_file(new_content):
43
print("Changing contents of " + LOCALFILE + " on local machine...")
44
- with open(LOCALFILE, 'w') as f:
+ with open(LOCALFILE, 'wb') as f:
45
f.write(new_content)
46
47
# Restore the local and Dropbox files to a certain revision
0 commit comments