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 <module>
        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)
pull/169/head
Daniel Hahler 12 years ago
parent 0547e23411
commit 6d98cf886d

@ -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:

Loading…
Cancel
Save