fsspec / filesystem_spec

A specification that python filesystems should adhere to.
BSD 3-Clause "New" or "Revised" License
1.04k stars 362 forks source link

Canonical form of memory urlpaths #1407

Open ap-- opened 1 year ago

ap-- commented 1 year ago

Hi @martindurant,

I'm currently fixing memory URI handling in universal_pathlib for python versions up to 3.11 and was wondering which URI would be considered the canonical form of a memory urlpath:

memory://path/to/file.txt
memory:///path/to/file.txt

universal_pathlib will support both as input but then normalize them to the one fsspec considers to be the standard.

Cheers, Andreas 😃

martindurant commented 1 year ago

Typical use is the former, but I think both should work correctly with the current implementation. memoryFS is used a lot for testing, so it can be used in comparisons where a target FS uses the extra "/" (local on posix) or not (s3). It would probably be fine to normalise away an extra "/", leaving two.