summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-13 23:17:11 +0200
committerhut <hut@lepus.uberspace.de>2015-04-13 23:17:11 +0200
commit59450640fe0374f27e458a917ac74d6f6bf200b4 (patch)
tree980d992bb192fb20468833d6a848ef16f086e60a
parent2e74f350b7b33d8a401ca185274ad5f3455a6207 (diff)
downloadranger-59450640fe0374f27e458a917ac74d6f6bf200b4.tar.gz
core.linemode: fix python3 crash in FileInfoLinemode
-rw-r--r--ranger/core/linemode.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/core/linemode.py b/ranger/core/linemode.py
index 529c6b93..56fd3522 100644
--- a/ranger/core/linemode.py
+++ b/ranger/core/linemode.py
@@ -3,6 +3,7 @@
 # License: GNU GPL version 3, see the file "AUTHORS" for details.
 # Author: Wojciech Siewierski <wojciech.siewierski@onet.pl>, 2015
 
+import sys
 from abc import *
 
 DEFAULT_LINEMODE = "filename"
@@ -96,6 +97,8 @@ class FileInfoLinemode(LinemodeBase):
         if not file.is_directory:
             from subprocess import check_output
             fileinfo = check_output(["file", "-bL", file.path]).strip()
+            if sys.version_info[0] >= 3:
+                fileinfo = fileinfo.decode("utf-8")
             return fileinfo
         else:
             raise NotImplementedError