1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

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)
This commit is contained in:
Daniel Hahler 2012-12-18 11:52:57 +01:00
parent 0547e23411
commit 6d98cf886d

View File

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