-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Already canonicalized path cannot be re-canonicalized with relative paths #80884
Comments
I think this is fundamentally a duplicate of #42869 and #59117. On Windows,
Unfortunately, none of these are easy or without substantial risk. |
This was news for me, and reason I opened this issue. It's not obvious. In short term, implementing a On your last point, any external crate experiment for larger re-think should probably try to architect it along these lines: #66621 because it's not uncommon need to handle posix paths in Windows; or vice versa. |
If you're looking to safely use |
I tried this code:
I expected to see this happen:
Last line should work. Error on the last line means that already canonicalized path (with UNC start) cannot be re-canonicalized with relative paths in them.
This is especially problematic because
canonicalize
is only way to normalize paths. Issue could be solved if there were a way to normalize paths (e.g. #59117) without calling Windows API, which probably is the culprit here.Instead, this happened:
Last line throws an error.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: