Open chfw opened 5 years ago
As @willmcgugan hinted at in the other issue, there's likely to be subtle differences between "external URLs" (as returned by geturl
or geturl(purpose='download')
) and FS URLs (as returned by geturl(purpose='fs')
and 'consumed' by open_fs
).
There may be places in which an external-URL and an FS-URL are identical, but there may also be corner-cases in which they're different. @willmcgugan perhaps the documentation at https://pyfilesystem2.readthedocs.io/en/latest/openers.html could / should be made clearer in this regard? Or should open_fs
(and OSFS.geturl
) be adapted to better work with external-URLs? (with external-URLs still being a subset of FS-URLs)
The docs could definitely use more detail here. I will update that once @chfw has merged his changes.
Generally though, FS URLs generated with purpose="fs"
don't need to be compatible with anything outside PyFilesystem. So they don't really need to follow the spec for file://
urls as long as they work with open_fs
.
In the default case where purpose="download"
the URLs should follow the appropriate spec. I can see from the current implementation in osfs.py that the geturl
implementation is naive.
@chfw keep us posted!
Hi all,
Referring to the blog (https://blogs.msdn.microsoft.com/ie/2006/12/06/file-uris-in-windows/) shared by @lurch , the proper windows file uri for:
D:\Program Files\Viewer\startup.htm
is:Please notice
file:///
overfile://
. Here is how it manifest itself in appveyor:https://ci.appveyor.com/project/willmcgugan/pyfilesystem2/builds/26552739/job/1478h3r51d5renwg
Here is how to reproduce it with fs:
I am still thinking of a fix.