From 6d98cf886deb26fc7923461d46c293500bebc6c8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 18 Dec 2012 11:52:57 +0100 Subject: [PATCH] Do not decode os.path.realpath / path `path` is decoded already (coming from `db`) and this caused the following error: Traceback (most recent call last): File "/home/user/.autojump/bin/autojump", line 460, in if not shell_utility(): sys.exit(1) File "/home/user/.autojump/bin/autojump", line 429, in shell_utility results = find_matches(db, patterns, max_matches, False) File "/home/user/.autojump/bin/autojump", line 374, in find_matches if current_dir == decode(os.path.realpath(path)) : File "/home/user/.autojump/bin/autojump", line 277, in decode return text.decode(encoding, errors) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeEncodeError: 'ascii' codec can't encode character u'\xb4' in position 52: ordinal not in range(128) --- bin/autojump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autojump b/bin/autojump index c2f3a22..2fb54c3 100755 --- a/bin/autojump +++ b/bin/autojump @@ -380,7 +380,7 @@ def find_matches(db, patterns, max_matches=1, ignore_case=False, fuzzy=False): if found and (os.path.exists(path) or TESTING): # avoid jumping to current directory # (call out to realpath this late to not stat all dirs) - if current_dir == decode(os.path.realpath(path)) : + if current_dir == os.path.realpath(path): continue if path not in results: