From 11e703e7552fed7289510c6811caf17b2cee6753 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Sun, 28 Dec 2025 06:57:39 -0600 Subject: [PATCH] [pathlib] Deprecate `PurePath.as_uri` (#15178) --- stdlib/pathlib/__init__.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/pathlib/__init__.pyi b/stdlib/pathlib/__init__.pyi index fa5143f20..33652d922 100644 --- a/stdlib/pathlib/__init__.pyi +++ b/stdlib/pathlib/__init__.pyi @@ -90,6 +90,7 @@ class PurePath(PathLike[str]): def __rtruediv__(self, key: StrPath) -> Self: ... def __bytes__(self) -> bytes: ... def as_posix(self) -> str: ... + @deprecated("Deprecated since Python 3.14; will be removed in Python 3.19. Use `Path.as_uri()` instead.") def as_uri(self) -> str: ... def is_absolute(self) -> bool: ... if sys.version_info >= (3, 13): @@ -345,6 +346,8 @@ class Path(PurePath): self, top_down: bool = True, on_error: Callable[[OSError], object] | None = None, follow_symlinks: bool = False ) -> Iterator[tuple[Self, list[str], list[str]]]: ... + def as_uri(self) -> str: ... + class PosixPath(Path, PurePosixPath): __slots__ = ()