diff options
-rw-r--r-- | ranger/defaults/apps.py | 2 | ||||
-rw-r--r-- | ranger/defaults/keys.py | 2 | ||||
-rw-r--r-- | ranger/fsobject/fsobject.py | 11 |
3 files changed, 8 insertions, 7 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py index 01f11f24..e2def3d3 100644 --- a/ranger/defaults/apps.py +++ b/ranger/defaults/apps.py @@ -83,8 +83,6 @@ class CustomApplications(Applications): if f.document or f.filetype.startswith('text'): return self.app_editor(c) - raise Exception(f.filetype) - # ----------------------------------------- application definitions def app_pager(self, c): diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index a573279c..9c615933 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -15,7 +15,7 @@ """ This is the default key configuration file of ranger. -Syntax for binding keys: bind(*keys, fnc) +Syntax for binding keys: map(*keys, fnc) keys are one or more key-combinations which are either: * a string diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 8ad6d489..49936c3f 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -91,10 +91,13 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): def filetype(self): if self._filetype is None: import subprocess - got = subprocess.Popen(["file", '-Lb', '--mime-type', self.path],\ - stdout=subprocess.PIPE) \ - .communicate()[0] - self._filetype = got + try: + got = subprocess.Popen(["file", '-Lb', '--mime-type',\ + self.path], stdout=subprocess.PIPE).communicate()[0] + except OSError: + self._filetype = '' + else: + self._filetype = got return self._filetype def get_description(self): |