mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
only open files as utf-8 with Python 3.0+
This commit is contained in:
parent
024d550c8c
commit
2c75c36229
@ -114,7 +114,7 @@ class Database:
|
|||||||
"""
|
"""
|
||||||
if os.path.exists(self.filename):
|
if os.path.exists(self.filename):
|
||||||
try:
|
try:
|
||||||
if sys.version > (2, 6):
|
if sys.version_info >= (3, 0):
|
||||||
with open(self.filename, 'r', encoding = 'utf-8') as f:
|
with open(self.filename, 'r', encoding = 'utf-8') as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
weight, path = line[:-1].split("\t", 1)
|
weight, path = line[:-1].split("\t", 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user