about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/metadata.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ranger/core/metadata.py b/ranger/core/metadata.py
index 75f7ba3c..833d6e3e 100644
--- a/ranger/core/metadata.py
+++ b/ranger/core/metadata.py
@@ -15,6 +15,7 @@ from __future__ import (absolute_import, division, print_function)
 
 import copy
 from os.path import join, dirname, exists, basename
+from ranger.ext.open23 import open23
 from ranger.ext.openstruct import DefaultOpenStruct as ostruct
 
 
@@ -26,9 +27,9 @@ class MetadataManager(object):
 
     def __init__(self):
         # metadata_cache maps filenames to dicts containing their metadata
-        self.metadata_cache = dict()
+        self.metadata_cache = {}
         # metafile_cache maps .metadata.json filenames to their entries
-        self.metafile_cache = dict()
+        self.metafile_cache = {}
         self.deep_search = DEEP_SEARCH_DEFAULT
 
     def reset(self):
@@ -84,7 +85,7 @@ class MetadataManager(object):
         self.metadata_cache[filename] = entry
         self.metafile_cache[metafile] = entries
 
-        with open(metafile, "w") as fobj:
+        with open23(metafile, "w") as fobj:
             json.dump(entries, fobj, check_circular=True, indent=2)
 
     def _get_entry(self, filename):
@@ -117,7 +118,7 @@ class MetadataManager(object):
             return self.metafile_cache[metafile]
 
         if exists(metafile):
-            with open(metafile, "r") as fobj:
+            with open23(metafile, "r") as fobj:
                 try:
                     entries = json.load(fobj)
                 except ValueError: