From 363412f691b018c4fe13fbc9399332fd340ff642 Mon Sep 17 00:00:00 2001 From: mih Date: Fri, 27 Jan 2023 09:19:10 +0000 Subject: [PATCH] Added a comment: file:/// must be forced to file:// on windows --- ..._a9bd50ebe805afefab103da31b88cf89._comment | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/bugs/git-annex_drop_fails_to_access_file__58____47____47____47___target_URL_on_Windows/comment_3_a9bd50ebe805afefab103da31b88cf89._comment diff --git a/doc/bugs/git-annex_drop_fails_to_access_file__58____47____47____47___target_URL_on_Windows/comment_3_a9bd50ebe805afefab103da31b88cf89._comment b/doc/bugs/git-annex_drop_fails_to_access_file__58____47____47____47___target_URL_on_Windows/comment_3_a9bd50ebe805afefab103da31b88cf89._comment new file mode 100644 index 0000000000..3e3f19d19d --- /dev/null +++ b/doc/bugs/git-annex_drop_fails_to_access_file__58____47____47____47___target_URL_on_Windows/comment_3_a9bd50ebe805afefab103da31b88cf89._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="mih" + avatar="http://cdn.libravatar.org/avatar/f881df265a423e4f24eff27c623148fd" + subject="file:/// must be forced to file:// on windows" + date="2023-01-27T09:19:10Z" + content=""" +I just want to leave a note that the `file:` URL scheme handling on windows is still problematic. A file URL (e.g. generated by Python's `pathlib.as_uri()`) like the following does not work: + +``` +file:///C:/DLTMP/myarchive.zip +``` + +it is parsed to the path `/C:/DLTMP/myarchive.zip` (as reported by OP), which is invalid. + +A workaround is to replace `file:///` with `file://` (remove one slash). This makes git-annex accept the URL and parse it to the correct path `C:/DLTMP/myarchive.zip`. + +However, such a \"double-slash\" URL is invalid. [Wikipedia](https://en.wikipedia.org/wiki/File_URI_scheme) has a dedicated bit on \"How many slashes?\" which states + +> file://path (i.e. two slashes, without a hostname) is never correct, but is often used +"""]]