about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-01 23:55:25 +0100
committerhut <hut@lavabit.com>2010-01-01 23:55:25 +0100
commit811f5bb82769413e5f9b389f92218d05cbe1597e (patch)
tree73184a1621bb61dafca73d9b5ea850b0b1018cda
parent11ee0f3e0d9177731f85287cac3e67290b1bf127 (diff)
downloadranger-811f5bb82769413e5f9b389f92218d05cbe1597e.tar.gz
pager: fixed unicode decode error
-rw-r--r--ranger/gui/widgets/pager.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index d69d580e..0e13ecbd 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -147,10 +147,13 @@ class Pager(Widget):
 			return self.lines[n]
 		except (KeyError, IndexError):
 			if attempt_to_read and self.source_is_stream:
-				for l in self.source:
-					self.lines.append(l)
-					if len(self.lines) > n:
-						break
+				try:
+					for l in self.source:
+						self.lines.append(l)
+						if len(self.lines) > n:
+							break
+				except UnicodeError:
+					pass
 				return self._get_line(n, attempt_to_read=False)
 			return ""