Kaynağa Gözat

ci: fix find_build_apps.py failure with py3 due to non ascii chars

find_build_apps.py would fail when reading non-ascii chars on systems where
the default encoding was ascii.
Marius Vikhammer 5 yıl önce
ebeveyn
işleme
1d1e4497ba
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      tools/find_build_apps/common.py

+ 2 - 1
tools/find_build_apps/common.py

@@ -8,6 +8,7 @@ from collections import namedtuple
 import logging
 import json
 import typing
+from io import open
 
 DEFAULT_TARGET = "esp32"
 
@@ -320,7 +321,7 @@ class BuildSystem(object):
             readme_path = get_md_or_rst(os.path.dirname(app_path))
         if not readme_path:
             return None
-        with open(readme_path, "r") as readme_file:
+        with open(readme_path, "r", encoding='utf8') as readme_file:
             return readme_file.read()
 
     @staticmethod