about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-12-05 04:13:52 +0100
committerhut <hut@lepus.uberspace.de>2015-12-05 04:22:23 +0100
commita6831bcfaed029632d34812b7b7bebda01438c5e (patch)
tree3e2a8b62f24fc983b9ac954f2236ac9eb5b773b4
parent834cbb1d8459fb9d5c173dcf9ea2f0651ea09c58 (diff)
downloadranger-a6831bcfaed029632d34812b7b7bebda01438c5e.tar.gz
core.main: handle py3 encoding errors in --list-tagged-files
-rw-r--r--ranger/core/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 4c7c9482..319b248f 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -42,7 +42,10 @@ def main():
     if arg.list_tagged_files:
         fm = FM()
         try:
-            f = open(fm.confpath('tagged'), 'r')
+            if sys.version_info[0] >= 3:
+                f = open(fm.confpath('tagged'), 'r', errors='replace')
+            else:
+                f = open(fm.confpath('tagged'), 'r')
         except:
             pass
         else: