summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/fsobject/fsobject.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index b954d87f..f3d40614 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -167,17 +167,21 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 		elif self.is_directory:
 			try:
 				self.size = len(os.listdir(self.path))
-				self.infostring = " %d" % self.size
-				self.accessible = True
-				self.runnable = True
 			except OSError:
 				self.infostring = BAD_INFO
 				self.accessible = False
+			else:
+				self.infostring = " %d" % self.size
+				self.accessible = True
+				self.runnable = True
 		elif self.is_file:
-			self.size = self.stat.st_size
-			self.infostring = ' ' + human_readable(self.size)
+			try:
+				self.size = self.stat.st_size
+				self.infostring = ' ' + human_readable(self.size)
+			except:
+				pass
 		if self.is_link:
-			self.infostring = '->'
+			self.infostring = '->' + self.infostring
 
 	def load(self):
 		"""