From b03ade1996bb6abaa344d28a086c7ae158e0a992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Jirs=C3=A1k?= Date: Sat, 10 Apr 2021 17:33:17 +0200 Subject: [PATCH] Use explicit encoding for reading from file. open() without encoding uses platform default encoding. On WIndows it can be encoding which has some bytes undefined - for example Windows-1250 don't know 0x88. --- mx_ide_eclipse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mx_ide_eclipse.py b/mx_ide_eclipse.py index badeca8b..cb87296a 100644 --- a/mx_ide_eclipse.py +++ b/mx_ide_eclipse.py @@ -130,7 +130,7 @@ def read_core_prefs_file(self): class FileInfo: def __init__(self, path): self.path = path - with open(path) as fp: + with open(path, encoding='utf-8') as fp: self.content = fp.read() self.times = (os.path.getatime(path), mx.getmtime(path))