diff options
author | toonn <toonn@toonn.io> | 2021-09-01 17:53:15 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2021-09-01 17:57:15 +0200 |
commit | 9bd3ccdda523168589d7ee4d5c1a9d4610371791 (patch) | |
tree | df76421319f17590e55e0099fbc6881f4674cc90 /ranger | |
parent | cec7bd50aa61eabd1cd8b1da2f2c2115e7b23662 (diff) | |
download | ranger-9bd3ccdda523168589d7ee4d5c1a9d4610371791.tar.gz |
metadata: Force UTF-8 encoding
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/metadata.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/core/metadata.py b/ranger/core/metadata.py index 2c5165da..534c083c 100644 --- a/ranger/core/metadata.py +++ b/ranger/core/metadata.py @@ -86,7 +86,7 @@ class MetadataManager(object): self.metadata_cache[filename] = entry self.metafile_cache[metafile] = entries - with open(metafile, "w") as fobj: + with open(metafile, "w", encoding="utf-8") as fobj: json.dump(entries, fobj, check_circular=True, indent=2) def _get_entry(self, filename): @@ -119,7 +119,7 @@ class MetadataManager(object): return self.metafile_cache[metafile] if exists(metafile): - with open(metafile, "r") as fobj: + with open(metafile, "r", encoding="utf-8") as fobj: try: entries = json.load(fobj) except ValueError: |