Skip to content

upath.implementations.local: fix from_uri() backport on python<3.13 - #574

Merged
ap-- merged 2 commits into
fsspec:mainfrom
ap--:fix-localpath-from-uri
Nov 10, 2026
Merged

ap-- merged 2 commits into
fsspec:mainfrom
ap--:fix-localpath-from-uri

Conversation

@ap--

@ap-- ap-- commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

LocalPath.from_uri() on python<3.13 returned UPath(uri), i.e. a FilePath with a still percent-encoded path, instead of parsing the RFC 8089 file URI like pathlib.Path.from_uri() on 3.13+. Backport the 3.13 behaviour so type(p).from_uri(p.as_uri()) == p holds on all python versions, including UNC paths on Windows.

docs: explain the difference between RFC 8089 file URIs returned by PosixUPath/WindowsUPath.as_uri() and fsspec file:// urlpaths used by FilePath, and stop recommending UPath(p.as_uri()) to switch to FilePath.

ap-- added 2 commits November 9, 2026 22:17
LocalPath.from_uri() on python<3.13 returned UPath(uri), i.e. a FilePath
with a still percent-encoded path, instead of parsing the RFC 8089 file
URI like pathlib.Path.from_uri() on 3.13+. Backport the 3.13 behaviour so
type(p).from_uri(p.as_uri()) == p holds on all python versions, including
UNC paths on Windows.

docs: explain the difference between RFC 8089 file URIs returned by
PosixUPath/WindowsUPath.as_uri() and fsspec file:// urlpaths used by
FilePath, and stop recommending UPath(p.as_uri()) to switch to FilePath.
@ap--
ap-- merged commit daf3bcb into fsspec:main Nov 10, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant