mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-23 20:45:31 -07:00
Close #262 UnicodeDecodeError
* Problem was default decoder being ascii.
This commit is contained in:
parent
2653f4bdfd
commit
4e5b5b978e
4
plug.vim
4
plug.vim
@ -1192,7 +1192,7 @@ class Command(object):
|
|||||||
raise CmdTimedOut(['Timeout!'])
|
raise CmdTimedOut(['Timeout!'])
|
||||||
|
|
||||||
tfile.seek(0)
|
tfile.seek(0)
|
||||||
result = [line.decode().rstrip() for line in tfile]
|
result = [line.decode('utf-8', 'replace').rstrip() for line in tfile]
|
||||||
|
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
msg = ['']
|
msg = ['']
|
||||||
@ -1344,7 +1344,7 @@ def esc(name):
|
|||||||
def nonblock_read(fname):
|
def nonblock_read(fname):
|
||||||
""" Read a file with nonblock flag. Return the last line. """
|
""" Read a file with nonblock flag. Return the last line. """
|
||||||
fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
|
fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
|
||||||
buf = os.read(fread, 100000).decode()
|
buf = os.read(fread, 100000).decode('utf-8', 'replace')
|
||||||
os.close(fread)
|
os.close(fread)
|
||||||
|
|
||||||
line = buf.rstrip('\r\n')
|
line = buf.rstrip('\r\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user