From 117a0ba7073a93f2b91e5beae5748bdd909eba0b Mon Sep 17 00:00:00 2001 From: nameexhaustion Date: Wed, 11 Dec 2024 01:29:08 +1100 Subject: [PATCH] fix: Fix error writing on Windows to locations outside of C drive (#20245) --- crates/polars-io/src/utils/file.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/polars-io/src/utils/file.rs b/crates/polars-io/src/utils/file.rs index 465fa735ab18..fce0c620ed0b 100644 --- a/crates/polars-io/src/utils/file.rs +++ b/crates/polars-io/src/utils/file.rs @@ -70,10 +70,13 @@ pub fn try_get_writeable( } else { let path = resolve_homedir(&path); std::fs::File::create(&path).map_err(PolarsError::from)?; - let path = std::fs::canonicalize(&path)?; if verbose { - eprintln!("try_get_writeable: local: {}", path.to_str().unwrap()) + eprintln!( + "try_get_writeable: local: {} (canonicalize: {:?})", + path.to_str().unwrap(), + std::fs::canonicalize(&path) + ) } Ok(Box::new(polars_utils::open_file_write(&path)?))