Skip to content

Commit afe9554

Browse files
authored
patch for 'native' Windows
on windows, even if cp1252, a Notebook must be written in utf-8. Anaconda on Windows is not 'native', so doesn't have the problem.
1 parent 3901053 commit afe9554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python_packages/jupyter_lsp/jupyter_lsp/virtual_documents_shadow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def read_lines(self):
4141
lines = [""]
4242
try:
4343
# TODO: what to do about bad encoding reads?
44-
lines = self.path.read_text().splitlines()
44+
lines = self.path.read_text(encoding='utf-8').splitlines()
4545
except FileNotFoundError:
4646
pass
4747
return lines
4848

4949
@run_on_executor
5050
def write_lines(self):
5151
self.path.parent.mkdir(parents=True, exist_ok=True)
52-
self.path.write_text("\n".join(self.lines))
52+
self.path.write_text("\n".join(self.lines), encoding='utf-8')
5353

5454
@staticmethod
5555
def trim(lines: list, character: int, side: int):

0 commit comments

Comments
 (0)