diff options
Diffstat (limited to 'Mozo/MainWindow.py')
-rw-r--r-- | Mozo/MainWindow.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Mozo/MainWindow.py b/Mozo/MainWindow.py index 367b9c8..176c410 100644 --- a/Mozo/MainWindow.py +++ b/Mozo/MainWindow.py @@ -22,7 +22,9 @@ gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import GLib, Gio from gi.repository import Gtk, Gdk, GdkPixbuf -import cgi, os +import cgi +import codecs +import os import gettext import subprocess import urllib @@ -375,7 +377,8 @@ class MainWindow: if not os.path.isfile(file_path): data = open(item.get_desktop_file_path()).read() - open(file_path, 'w').write(data) + with codecs.open(file_path, 'w') as f: + f.write(data) self.editor._MenuEditor__addUndo([(file_type, os.path.split(file_path)[1]),]) else: self.editor._MenuEditor__addUndo([item,]) |