Skip to content

Commit

Permalink
MenuEditor: Don't write binary data as unicode
Browse files Browse the repository at this point in the history
g_keyfile_to_data returns binary data, not unicode
  • Loading branch information
magcius committed Apr 30, 2013
1 parent ab7684a commit 0d7f351
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Alacarte/MenuEditor.py
Expand Up @@ -263,7 +263,7 @@ def copyItem(self, item, new_parent, before=None, after=None):

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)
Expand Down Expand Up @@ -404,7 +404,7 @@ def writeItem(self, item, **kwargs):
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
Expand All @@ -426,7 +426,7 @@ def writeMenu(self, menu, **kwargs):
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

Expand Down

0 comments on commit 0d7f351

Please sign in to comment.