From 4e5b5b978e8c5fafd357710d1ba01ea8221c4331 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Thu, 30 Jul 2015 11:13:33 -0400 Subject: [PATCH] Close #262 UnicodeDecodeError * Problem was default decoder being ascii. --- plug.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index 9102a09..6e14d0e 100644 --- a/plug.vim +++ b/plug.vim @@ -1192,7 +1192,7 @@ class Command(object): raise CmdTimedOut(['Timeout!']) 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: msg = [''] @@ -1344,7 +1344,7 @@ def esc(name): def nonblock_read(fname): """ Read a file with nonblock flag. Return the last line. """ 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) line = buf.rstrip('\r\n')