test: pass forward-slash temp paths to generated Python scripts

On Windows the temp directory has backslashes, which a Python string literal reads
as escape sequences (C:\Users is a unicode escape), so the RasterImage and OLE
lifecycle tests could not even create their entity. Windows accepts forward slashes.
Found by the first Windows run of the fork build workflow; Linux passed all 60.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Felix RiestraandClaude Sonnet 5 committed 2026-09-21 19:56:22 +02:00
1 parent 33dfb21cfb
commit 20f75c34e1
1 file changed
+4 -1
+4 -1
View File
@@ -5039,7 +5039,10 @@ mod tests {
let _ = std::fs::remove_file(&path);
};
let tmp = std::env::temp_dir().to_string_lossy().into_owned();
// Substituted into Python string literals: on Windows a backslash path such as
// `C:\Users\...` is read as escape sequences (`\U` is a unicode escape), and Windows
// accepts forward slashes, so hand the script a forward-slash path.
let tmp = std::env::temp_dir().to_string_lossy().replace('\\', "/");
let mut create_script = case.create.replace("TMPDIR", &tmp);
// Insert is update-only: the host makes a block and one insert, and the
// "create" script only has to exist.