about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2019-03-04 19:34:04 +0100
committerrnhmjoj <rnhmjoj@inventati.org>2019-03-04 19:34:04 +0100
commit31494870fffe15d37d218727ae87dae6518ed365 (patch)
treed1ff4067d0e951b0c41f05741e45e3b8b1aae902
parent6944156c3150f1fe4ad8d7d75965e17b72017cc0 (diff)
downloadranger-31494870fffe15d37d218727ae87dae6518ed365.tar.gz
Fix crash when entering directories with invalid mtimes
closes #1020
-rw-r--r--ranger/gui/widgets/statusbar.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index 3457955e..f068bc7e 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -183,7 +183,11 @@ class StatusBar(Widget):  # pylint: disable=too-many-instance-attributes
                 left.add(target.infostring.replace(" ", ""))
                 left.add_space()
 
-            left.add(strftime(self.timeformat, localtime(stat.st_mtime)), 'mtime')
+            try:
+                date = strftime(self.timeformat, localtime(stat.st_mtime))
+            except OSError:
+                date = '?'
+            left.add(date, 'mtime')
 
         directory = target if target.is_directory else \
             target.fm.get_directory(os.path.dirname(target.path))