Skip to content

Commit d342592

Browse files
authored
specify encoding utf8 to open()
This prevents 'UnicodeDecodeError: 'charmap' codec can't decode byte [...]'
1 parent 283ec27 commit d342592

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cvim_server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def edit_file(content):
2626
os.close(fd)
2727
subprocess.Popen(shlex.split(VIM_COMMAND) + [fn]).wait()
2828
text = None
29-
with open(fn, 'r') as f:
29+
with open(fn, 'r', encoding='utf8') as f:
3030
text = f.read()
3131
os.unlink(fn)
3232
return text

0 commit comments

Comments
 (0)