From 6a32410e76a14b79af23dc049ad461177e06158e Mon Sep 17 00:00:00 2001 From: --global Date: Mon, 22 May 2023 13:05:26 -0400 Subject: [PATCH] Fix windows tests --- crates/turborepo-paths/src/relative_unix_path.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/turborepo-paths/src/relative_unix_path.rs b/crates/turborepo-paths/src/relative_unix_path.rs index c7d1c27571a6b..e210567c2e282 100644 --- a/crates/turborepo-paths/src/relative_unix_path.rs +++ b/crates/turborepo-paths/src/relative_unix_path.rs @@ -37,7 +37,9 @@ impl RelativeUnixPath { .iter() .map(|byte| if *byte == b'/' { b'\\' } else { *byte }) .collect::>(); - let system_path_string = String::from_utf8(system_path_bytes)?; + let system_path_string = String::from_utf8(system_path_bytes).map_err(|_| { + PathError::InvalidUnicode(String::from_utf8_lossy(&system_path_bytes).to_string()) + })?; Ok(PathBuf::from(system_path_string)) } }