about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-09-01 15:01:06 +0200
committertoonn <toonn@toonn.io>2021-09-01 16:03:48 +0200
commita84d909b80240d5a0e40cae5c6e433b428589ed6 (patch)
tree014b9d9676f006db2d81a02cadb9dc22f981ee3e /ranger
parent334ed60a4ab56cf027e5a45d5c465f88c8e5a78d (diff)
downloadranger-a84d909b80240d5a0e40cae5c6e433b428589ed6.tar.gz
main: Switch to io.open
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/main.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index d55f871b..cf058163 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -5,16 +5,16 @@
 
 from __future__ import (absolute_import, division, print_function)
 
-from logging import getLogger
 import atexit
 import locale
 import os.path
 import shutil
 import sys
 import tempfile
+from io import open
+from logging import getLogger
 
 from ranger import VERSION
-from ranger.ext.open23 import open23
 
 
 LOG = getLogger(__name__)
@@ -75,7 +75,7 @@ def main(
             return 1
         fm = FM()
         try:
-            with open23(fm.datapath('tagged'), 'r', errors='replace') as fobj:
+            with open(fm.datapath('tagged'), 'r', errors='replace') as fobj:
                 lines = fobj.readlines()
         except OSError as ex:
             print('Unable to open `tagged` data file: {0}'.format(ex), file=sys.stderr)
@@ -156,11 +156,11 @@ def main(
             tabs_datapath = fm.datapath('tabs')
             if fm.settings.save_tabs_on_exit and os.path.exists(tabs_datapath) and not args.paths:
                 try:
-                    with open23(tabs_datapath, 'r') as fobj:
+                    with open(tabs_datapath, 'r') as fobj:
                         tabs_saved = fobj.read().partition('\0\0')
                         fm.start_paths += tabs_saved[0].split('\0')
                     if tabs_saved[-1]:
-                        with open23(tabs_datapath, 'w') as fobj:
+                        with open(tabs_datapath, 'w') as fobj:
                             fobj.write(tabs_saved[-1])
                     else:
                         os.remove(tabs_datapath)
@@ -443,7 +443,7 @@ def load_settings(  # pylint: disable=too-many-locals,too-many-branches,too-many
 
             if not os.path.exists(fm.confpath('plugins', '__init__.py')):
                 LOG.debug("Creating missing '__init__.py' file in plugin folder")
-                with open23(fm.confpath('plugins', '__init__.py'), 'w'):
+                with open(fm.confpath('plugins', '__init__.py'), 'w'):
                     # Create the file if it doesn't exist.
                     pass