mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-26 11:28:51 -06:00
fix: read every source yaml as utf-8
This commit is contained in:
1 parent
d4aae50601
commit
812f2609db
10 files changed
+50
-44
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from typing import Any, TextIO
|
||||
|
||||
try:
|
||||
@@ -32,3 +33,9 @@ def source_yaml(stream: TextIO) -> Any:
|
||||
f"{where}: {problem}. Check it with: "
|
||||
"python scripts/validate_schemas.py --source-only"
|
||||
) from None
|
||||
|
||||
|
||||
def source_yaml_file(path: str | os.PathLike[str]) -> Any:
|
||||
"""source_yaml on a file of ours, read as UTF-8 whatever the locale."""
|
||||
with open(path, encoding="utf-8") as handle:
|
||||
return source_yaml(handle)
|
||||
Reference in new issue
Block a user