Skip to content

Commit bc333ec

Browse files
GeneWusiawyoung
authored andcommitted
Encode utf-8 for writing folder name output (#2)
1 parent cf5d297 commit bc333ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dropbox_folder_size.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
output.write('Below is a list of your largest Dropbox folders, ordered from largest to smallest. You chose a drill level of 2. Sizes are expressed as "%d", where 0 is in bytes, 1 is in KB, 2 is in MB, and 3 is in GB. \n' % denomination)
5555

5656
for folder in reversed(sorted(foldersizes.keys(), key=lambda x: foldersizes[x])):
57-
output.write('%s: %f' % (folder, foldersizes[folder]) + '\n')
57+
output.write('%s: %f' % (folder.encode('utf-8'), foldersizes[folder]) + '\n')
5858

5959
print "File dropbox_folder_sizes.txt successfully created in the same directory as this script!"
6060

6161
output.close()
62-
quit()
62+
quit()

0 commit comments

Comments
 (0)