Closed gashihiko closed 1 year ago
Was thinking, that the writing could be the issue. Thanks for writing it up. Just to be sure: you could reproduce the error and this change got rid of it?
Was thinking, that the writing could be the issue. Thanks for writing it up. Just to be sure: you could reproduce the error and this change got rid of it?
Yes, the change got rid of the error.
Thank you very much
Added encoding option when opening the tmpFile. Maybe Fixes #55 The bug that shows unnecessary diagnostics like
LSP: mypy: can't decode file 'path/to/file.py': 'utf-8' codec can't decode byte 0x82 in position 52: invalid st...
could be reproduced on Japanese Windows 10 when the file includes multi byte characters. By default, open() encodes a file in cp932 on my environment. The mypy causes the error when decode_python_encoding() in util.py tries to decode the tmp file by utf-8 codec. It is the default behavior unless the file encoding comment(e.g. # coding: latin-1) is written in the code.