summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-14 15:58:27 +0100
committerhut <hut@lavabit.com>2012-03-14 15:58:27 +0100
commit34fe9997beb32d40f7419e89321b75db6d5ae65d (patch)
tree781782e9200803b8bb01f94ffd210f320c85d364 /ranger
parent87b0d82e736f0ee64220be44b9d9875af00824c4 (diff)
downloadranger-34fe9997beb32d40f7419e89321b75db6d5ae65d.tar.gz
gui.ui: catch an exception with surrogates in "update title" code
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/ui.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index e6c7d065..69b8463b 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -293,10 +293,13 @@ class UI(DisplayableContainer):
 				split = cwd.rsplit(os.sep, self.settings.shorten_title)
 				if os.sep in split[0]:
 					cwd = os.sep.join(split[1:])
-			fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \
-					decode('utf-8', 'replace')
-			sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007")
-			sys.stdout.flush()
+			try:
+				fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \
+						decode('utf-8', 'replace')
+				sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007")
+				sys.stdout.flush()
+			except:
+				pass
 		self.win.refresh()
 
 	def finalize(self):
/blame/test/tc_history.py?h=v1.7.0-emacs&id=ffec67de733cfa2ee1c2dab6b87f933565180330'>^
3dbefa71 ^
22bb7e35 ^

3dbefa71 ^


22bb7e35 ^
3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
22bb7e35 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44