From 107e4515bd87a8e7e137cf08b1535b603ecc10e9 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 13 Dec 2024 21:38:48 +0100 Subject: [PATCH] tests: fix a few open(...) calls (#48113) --- lib/spack/spack/test/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/test/main.py b/lib/spack/spack/test/main.py index af6a728291c..4353fa800ee 100644 --- a/lib/spack/spack/test/main.py +++ b/lib/spack/spack/test/main.py @@ -119,7 +119,7 @@ def test_bad_command_line_scopes(tmp_path, config): def test_add_command_line_scopes(tmpdir, mutable_config): config_yaml = str(tmpdir.join("config.yaml")) - with open(config_yaml, "w") as f: + with open(config_yaml, "w", encoding="utf-8") as f: f.write( """\ config: @@ -137,7 +137,7 @@ def test_add_command_line_scope_env(tmp_path, mutable_mock_env_path): """Test whether --config-scope works, either by name or path.""" managed_env = ev.create("example").manifest_path - with open(managed_env, "w") as f: + with open(managed_env, "w", encoding="utf-8") as f: f.write( """\ spack: @@ -147,7 +147,7 @@ def test_add_command_line_scope_env(tmp_path, mutable_mock_env_path): """ ) - with open(tmp_path / "spack.yaml", "w") as f: + with open(tmp_path / "spack.yaml", "w", encoding="utf-8") as f: f.write( """\ spack: