diff options
author | toonn <toonn@toonn.io> | 2021-08-27 19:53:44 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2021-08-27 19:53:44 +0200 |
commit | ee4b970e6b80920d7468c68b3464468e9c2f54ce (patch) | |
tree | ac996cf11abdfa70d546cae7165f70b52ed826fe | |
parent | c72830dda410523fd70db04d88412d3d00821e21 (diff) | |
download | ranger-ee4b970e6b80920d7468c68b3464468e9c2f54ce.tar.gz |
main: Switch to open23, forcing UTF-8
-rw-r--r-- | ranger/core/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py index 03c9f9b6..d55f871b 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -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 open(tabs_datapath, 'r') as fobj: + with open23(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 open(tabs_datapath, 'w') as fobj: + with open23(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 open(fm.confpath('plugins', '__init__.py'), 'w'): + with open23(fm.confpath('plugins', '__init__.py'), 'w'): # Create the file if it doesn't exist. pass |