thomasfrederikhoeck opened a new issue, #5592:
URL: https://github.com/apache/arrow-rs/issues/5592
**Describe the bug**
When creating a `Path` on Windows colon (`:`) is not sanitized like `<` and
`|`.
**To Reproduce**
```rust
use object_store::path::{Path};
fn main() {
let path: String = r"C:\table\time=2021-01-02
03:04:06.000003\file.parquet".to_string();
// let path: Result<Path, object_store::path::Error> = Path::parse(path);
let path_from = Path::from(path);
println!( "{:?}", path_from);
let path: String = r"C:\table\time=2021-01-02
03:04:06.000003\file.parquet".to_string();
let path_parse: Result<Path, object_store::path::Error> =
Path::parse(path);
println!( "{:?}", path_parse);
let path: String = r"C:\table\time=2021-01-02
03:04:06.000003\<file|.parquet".to_string();
// let path: Result<Path, object_store::path::Error> = Path::parse(path);
let path_from = Path::from(path);
println!( "{:?}", path_from);
let path: String = r"C:\table\time=2021-01-02
03:04:06.000003\<file|.parquet".to_string();
let path_parse: Result<Path, object_store::path::Error> =
Path::parse(path);
println!( "{:?}", path_parse);
}
```
```
Path { raw: "C:%5Ctable%5Ctime=2021-01-02 03:04:06.000003%5Cfile.parquet" }
Ok(Path { raw: "C:\\table\\time=2021-01-02 03:04:06.000003\\file.parquet" })
Path { raw: "C:%5Ctable%5Ctime=2021-01-02
03:04:06.000003%5C%3Cfile%7C.parquet" }
Ok(Path { raw: "C:\\table\\time=2021-01-02 03:04:06.000003\\<file|.parquet"
})
```
See SO for forbidden chars
https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names
**Expected behavior**
I would have expected the output to be
```
Path { raw: "C:%5Ctable%5Ctime=2021-01-02
03%3A04%3A06.000003%5Cfile.parquet" }
Ok(Path { raw: "C:\\table\\time=2021-01-02 03:04:06.000003\\file.parquet" })
Path { raw: "C:%5Ctable%5Ctime=2021-01-02
03%3A04%3A06.000003%5C%3Cfile%7C.parquet" }
Ok(Path { raw: "C:\\table\\time=2021-01-02 03:04:06.000003\\<file|.parquet"
})
```
**Additional context**
This came up here https://github.com/delta-io/delta-rs/issues/2382
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]