Skip to content

Commit cdfdbb5

Browse files
authored
Merge pull request #465 from bfredl/bytehack
py3file: read file as bytes so compile() can detect encoding
2 parents a70cdc9 + 344934c commit cdfdbb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pynvim/plugin/script_host.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def python_execute(self, script, range_start, range_stop):
100100
def python_execute_file(self, file_path, range_start, range_stop):
101101
"""Handle the `pyfile` ex command."""
102102
self._set_current_range(range_start, range_stop)
103-
with open(file_path) as f:
103+
with open(file_path, 'rb') as f:
104104
script = compile(f.read(), file_path, 'exec')
105105
try:
106106
exec(script, self.module.__dict__)

0 commit comments

Comments
 (0)