From 59450640fe0374f27e458a917ac74d6f6bf200b4 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 13 Apr 2015 23:17:11 +0200 Subject: core.linemode: fix python3 crash in FileInfoLinemode --- ranger/core/linemode.py | 3 +++ 1 file changed, 3 insertions(+) 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 , 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 -- cgit 1.4.1-2-gfad0