Skip to content

Commit

Permalink
fix: Fix error writing on Windows to locations outside of C drive (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion authored Dec 10, 2024
1 parent b12a543 commit 117a0ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/polars-io/src/utils/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?))
Expand Down

0 comments on commit 117a0ba

Please sign in to comment.