Skip to content

Commit

Permalink
Close #262 UnicodeDecodeError
Browse files Browse the repository at this point in the history
* Problem was default decoder being ascii.
  • Loading branch information
starcraftman committed Jul 30, 2015
1 parent 2653f4b commit 4e5b5b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ['']
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 4e5b5b9

Please sign in to comment.