Skip to content

Commit 54b1371

Browse files
committed
fix(e2e): 232 must read workflow files as UTF-8, not the platform code page
1 parent 37bb40a commit 54b1371

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/e2e/232_workflow_syntax.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ bad = []
4848
files = sorted(p for p in pathlib.Path(sys.argv[1]).iterdir()
4949
if p.suffix in (".yml", ".yaml"))
5050
for p in files:
51-
text = p.read_text()
51+
# encoding is NOT optional: Python on Windows defaults to the ANSI code
52+
# page, and these files are UTF-8 (em dashes in the comments are enough).
53+
# Without it the check dies with
54+
# UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d
55+
# on the runner and nowhere else.
56+
text = p.read_text(encoding="utf-8")
5257
for n, line in enumerate(text.splitlines(), 1):
5358
if TRAILING_AFTER_QUOTED.match(line):
5459
bad.append(f"{p.name}:{n}: content after a quoted scalar: {line.strip()}")

0 commit comments

Comments
 (0)