Skip to content

Commit 6fd72c3

Browse files
authored
Merge pull request #60 from gashihiko/fix/decode-error-on-non-utf-8-environment
Fix decode error on non-utf8 environments
2 parents c055d36 + a2536f7 commit 6fd72c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylsp_mypy/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ def get_diagnostics(
234234
global tmpFile
235235
if live_mode and not is_saved:
236236
if tmpFile:
237-
tmpFile = open(tmpFile.name, "w")
237+
tmpFile = open(tmpFile.name, "w", encoding="utf-8")
238238
else:
239-
tmpFile = tempfile.NamedTemporaryFile("w", delete=False)
239+
tmpFile = tempfile.NamedTemporaryFile("w", delete=False, encoding="utf-8")
240240
log.info("live_mode tmpFile = %s", tmpFile.name)
241241
tmpFile.write(document.source)
242242
tmpFile.close()

0 commit comments

Comments
 (0)