summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-23 19:42:40 +0100
committernfnty <git@nfnty.se>2017-01-23 19:42:40 +0100
commitd07c60e464a5e70ae8a762f828221b235ce11818 (patch)
treedbc6d2412e619196ee62f50c16b7dfbd113a86d0 /ranger
parentcc358f9a9e4c3820aadea8b72ab170f2c09300b3 (diff)
downloadranger-d07c60e464a5e70ae8a762f828221b235ce11818.tar.gz
core.linemode: `FileInfoLinemode`: Output is already decoded
Fixes Python 3 crash
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/linemode.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/ranger/core/linemode.py b/ranger/core/linemode.py
index e4c6c3a4..3a29b552 100644
--- a/ranger/core/linemode.py
+++ b/ranger/core/linemode.py
@@ -5,8 +5,6 @@
 
 from __future__ import (absolute_import, division, print_function)
 
-import sys
-
 from abc import ABCMeta, abstractproperty, abstractmethod
 from datetime import datetime
 from ranger.ext.human_readable import human_readable
@@ -102,11 +100,9 @@ class FileInfoLinemode(LinemodeBase):
         if not fobj.is_directory:
             from subprocess import CalledProcessError
             try:
-                fileinfo = spawn.check_output(["file", "-bL", fobj.path]).strip()
+                fileinfo = spawn.check_output(["file", "-Lb", fobj.path]).strip()
             except CalledProcessError:
                 return "unknown"
-            if sys.version_info[0] >= 3:
-                fileinfo = fileinfo.decode("utf-8")
             return fileinfo
         else:
             raise NotImplementedError