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

fix for backwards compatibility with 2.x pickles

This commit is contained in:
Joel Schaerer 2010-10-24 11:36:24 +02:00
parent 4d371fad21
commit c25668f4f7

View File

@ -112,7 +112,8 @@ def find_matches(dirs,patterns,result_list,ignore_case,max_matches):
def open_dic(dic_file,error_recovery=False):
try:
aj_file=open(dic_file, 'rb')
path_dict=pickle.load(aj_file)
#encoding is only specified for python2.x compatibility
path_dict=pickle.load(aj_file,encoding="utf-8")
aj_file.close()
return path_dict
except (IOError,EOFError,pickle.UnpicklingError):