test(ci): write the docker recovery shim with LF like the uname shim

On Windows, write_text() gave the generated #!/bin/sh docker shim CRLF line
endings. Git Bash still ran it (on the Windows 11 ARM64 VM: rc 0 and a clean
argv either way), so no test failed. Writing it with newline="\n" matches the
uname shim and keeps the test from depending on bash tolerating a CR.

Reported by Greptile on #159146.
This commit is contained in:
BearHuddleston
2026-11-23 08:10:55 +00:00
parent b0127090a9
commit 2304f34aea

View File

@@ -548,7 +548,7 @@ def test_docker_recovery_refuses_to_replace_a_divergent_version_tag(tmp_path):
)
docker = bindir / "docker"
docker.write_text(f'#!/bin/sh\nexec "{Path(sys.executable).as_posix()}" "{fake.as_posix()}" "$@"\n',
encoding="utf-8")
encoding="utf-8", newline="\n")
docker.chmod(0o755)
result = subprocess.run(
["bash", "-e", "-o", "pipefail", "-c",