commit 0d7f35124a0e23a0aaf57edf0e2d84f9ba1f12d8 Author: Jasper St. Pierre Date: Tue Apr 30 00:08:55 2013 -0400 MenuEditor: Don't write binary data as unicode g_keyfile_to_data returns binary data, not unicode diff --git a/Alacarte/MenuEditor.py b/Alacarte/MenuEditor.py index 15523e2..4ed7172 100644 --- a/Alacarte/MenuEditor.py +++ b/Alacarte/MenuEditor.py @@ -263,7 +263,7 @@ class MenuEditor(object): contents, length = keyfile.to_data() - with codecs.open(out_path, 'w', 'utf8') as f: + with open(out_path, 'w') as f: f.write(contents) self.addItem(new_parent, file_id, dom) @@ -404,7 +404,7 @@ class MenuEditor(object): contents, length = keyfile.to_data() path = os.path.join(util.getUserItemPath(), file_id) - with codecs.open(path, 'w', 'utf8') as f: + with open(path, 'w') as f: f.write(contents) return file_id @@ -426,7 +426,7 @@ class MenuEditor(object): contents, length = keyfile.to_data() path = os.path.join(util.getUserDirectoryPath(), file_id) - with codecs.open(path, 'w', 'utf8') as f: + with open(path, 'w') as f: f.write(contents) return file_id