diff options
-rw-r--r-- | ranger/gui/widgets/console.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 29c13e22..f6d3461f 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -45,7 +45,7 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- self.historypath = self.fm.datapath('history') if os.path.exists(self.historypath): try: - with open(self.historypath, "r") as fobj: + with open(self.historypath, "r", encoding="utf-8") as fobj: try: for line in fobj: self.history.add(line[:-1]) @@ -80,7 +80,7 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- return if self.historypath: try: - with open(self.historypath, 'w') as fobj: + with open(self.historypath, 'w', encoding="utf-8") as fobj: for entry in self.history_backup: try: fobj.write(entry + '\n') |