about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-08-27 19:36:41 +0200
committertoonn <toonn@toonn.io>2021-08-27 19:36:41 +0200
commit13fbf129b19730d46459feddd89c78aa44feafe1 (patch)
tree9f39be52e45e589ce641ac3a7ecbad84ce59aedf
parent96b7a07cb67e7264ad6e7b4ef3d3e7fdf70c70b5 (diff)
downloadranger-13fbf129b19730d46459feddd89c78aa44feafe1.tar.gz
console: Switch to open23
-rw-r--r--ranger/gui/widgets/console.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 02676f45..a6b90a35 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -13,6 +13,7 @@ from collections import deque
 from ranger import PY3
 from ranger.gui.widgets import Widget
 from ranger.ext.direction import Direction
+from ranger.ext.open23 import open23
 from ranger.ext.widestring import uwid, WideString
 from ranger.container.history import History, HistoryEmptyException
 import ranger
@@ -44,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 open23(self.historypath, "r") as fobj:
                         try:
                             for line in fobj:
                                 self.history.add(line[:-1])
@@ -79,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 open23(self.historypath, 'w') as fobj:
                     for entry in self.history_backup:
                         try:
                             fobj.write(entry + '\n')