Decode Cargo metadata as UTF-8 on Windows

This commit is contained in:
FredApps
2026-11-18 13:26:52 +01:00
parent ce732d2b8b
commit 83131112ab
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ def workspace_names(metadata):
def check_workspace():
result = subprocess.run(
["cargo", "metadata", "--no-deps", "--offline", "--locked", "--format-version", "1"],
cwd=ROOT, check=True, stdout=subprocess.PIPE, text=True,
cwd=ROOT, check=True, stdout=subprocess.PIPE, text=True, encoding="utf-8",
)
names = workspace_names(json.loads(result.stdout))
# From this virtual workspace root, cargo fmt normally checks all workspace packages.
+1
View File
@@ -179,6 +179,7 @@ class PackageFormatting(unittest.TestCase):
["cargo", "fmt", "--check", "--package", "craft-a"],
["cargo", "fmt", "--check", "--package", "craft-b"],
])
self.assertEqual(execute.call_args_list[0].kwargs["encoding"], "utf-8")
for call in execute.call_args_list:
self.assertEqual(call.kwargs["cwd"], ROOT)
self.assertTrue(call.kwargs["check"])