diff options
-rw-r--r-- | ranger/gui/widgets/statusbar.py | 6 |
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)) |