Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review feedback
  • Loading branch information
barneygale committed Mar 20, 2025
commit 385e6848034d1faa1f051c2abcedeb72b5871399
7 changes: 4 additions & 3 deletions Lib/pathlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import os
import posixpath
import sys
import warnings
from errno import *
from glob import _StringGlobber, _no_recurse_symlinks
from itertools import chain
Expand Down Expand Up @@ -522,19 +521,21 @@ def is_absolute(self):
def is_reserved(self):
"""Return True if the path contains one of the special names reserved
by the system, if any."""
import warnings
msg = ("pathlib.PurePath.is_reserved() is deprecated and scheduled "
"for removal in Python 3.15. Use os.path.isreserved() to "
"detect reserved paths on Windows.")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
warnings._deprecated("pathlib.PurePath.is_reserved", msg, remove=(3, 15))
if self.parser is ntpath:
return self.parser.isreserved(self)
return False

def as_uri(self):
"""Return the path as a URI."""
import warnings
msg = ("pathlib.PurePath.as_uri() is deprecated and scheduled "
"for removal in Python 3.19. Use pathlib.Path.as_uri().")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
warnings._deprecated("pathlib.PurePath.as_uri", msg, remove=(3, 19))
if not self.is_absolute():
raise ValueError("relative path can't be expressed as a file URI")

Expand Down
Loading