[scripts] ensure files use 'utf-8' encoding and '\n' newlines (#7872)

This commit is contained in:
Mike Fährmann
2025-07-22 16:53:40 +02:00
parent afc5b9c9c6
commit e8b2a496ba
7 changed files with 21 additions and 16 deletions

View File

@@ -71,7 +71,7 @@ def get_test_source(extr, *, cache={}):
tests = cache[extr.__module__]
except KeyError:
path = sys.modules[extr.__module__].__file__
with open(path) as fp:
with util.open(path) as fp:
lines = fp.readlines()
tests = cache[extr.__module__] = extract_tests_from_source(lines)
return tests.get(extr.url) or ("",)