-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Drive mismatch exception #5123
Comments
Maybe this should just let the later drive win. When I wrote this code, I wasn't sure what to do in this case, so I just played it safe and made it an error. |
I think that's the correct way to go. |
Presumably this should behave the same as linux, so the last absolute path should win. |
I'm pretty sure it already does that on all UNIX flavors. I just wasn't sure about drives. |
Ok, so I'm considering just removing this line but it seems like this error should never have happened in the first place since the second path should be considered absolute. I think that in the case of mixed drives where the paths are relative an error really is the only reasonable thing to do. What should |
Ah, ok. How about this teensy little change: diff --git a/base/path.jl b/base/path.jl
index 627689f..7ccbe93 100644
--- a/base/path.jl
+++ b/base/path.jl
@@ -12,7 +12,7 @@ end
@windows_only begin
const path_separator = "\\"
const path_separator_re = r"[/\\]+"
- const path_absolute_re = r"^(?:\w+:)[/\\]"
+ const path_absolute_re = r"^(?:\w+:)?[/\\]"
const path_directory_re = r"(?:^|[/\\])\.{0,2}$"
const path_dir_splitter = r"^(.*?)([/\\]+)([^/\\]*)$"
const path_ext_splitter = r"^((?:.*[/\\])?(?:\.|[^/\\\.])[^/\\]*?)(\.[^/\\\.]*|)$" I think that may have been what I originally intended but I'm not sure what should be considered absolute on Windows. cc: @loladiro, @vtjnash, @karbarcca for guidance. |
It's absolute if it starts with \ or if the second character is a colon and the first is A-Za-z "[A-Za-z]:|\\" (with two backslashes in the regex) Although sometimes / is accepted as a valid path separated, traditionally it is treated as an invalid token |
Ok, can you just fix the regex then? |
I'm quite sure that you need a backslash/slash for an absolute path on windows. E.g. |
Oops, yes that's right. I thought c: specified the root of the drive, however? |
OK, now that i'm at a computer I can look up the definitive resource: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx DOS chokes on so it seems a path is absolute if it matches They devote an entire section explaining how useful it is that windows can use a different path for every drive to save you effort. More fun facts from that help site: If you end a file name with a |
why does this operating system exist? |
Won't be long before nobody knows what a "drive" is :) |
Sure they will. They're those weird letters at the beginnings of Windows paths. |
Love it. |
Am I correct that this fix is not in v0.2.1? I keep getting this drive mismatch error. The v0.3-prerelease is working though. However, I would like to use Julia Studio and this doesn't work with the v0.3 release yet. Anyway I can get v0.2.1 working? |
Yes, this fix is not in the 0.2 branch. The main developers have only backported a few fixes to the release branch, and the community has not picked up the ball and contributed Pull Requests. I intend to help backport fixes for the 0.3 release branch once 0.3 gets released. |
StefanKarpinski commented 3 months ago:
It's an operating system? I thought it was a text adventure. No wonder I haven't seen the Wumpus in years! |
Thanks! In the meantime, should copying the new path.jl to the
|
Copying the fix is just half of the process. You will also need to regenerate the cache, but unfortunately I don't know how to do that for 0.2 when you are not compiling from source. To speed up the process of starting Julia, she parses the base library and caches the parsed AST in the Grepping revieals a |
Delete or move |
Thanks, worked like a charm! |
On launch Julia throws the following error:
ErrorException("drive mismatch: C:\julia-05c6461b55 \\vulcan\home$\u100012\AppData\julia")
Looking at julia/base/path.jl, joinpath(a, b) appears to assume that a and b will both be C:\ or UNC style so doesn't account for a mixed case.
The text was updated successfully, but these errors were encountered: