Skip to content

GH-125413: Add private metadata methods to pathlib.Path.info #129897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions Lib/pathlib/_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from abc import ABC, abstractmethod
from glob import _PathGlobber, _no_recurse_symlinks
from pathlib import PurePath, Path
from pathlib._os import magic_open, CopyReader, CopyWriter
from pathlib._os import magic_open, CopyWriter


def _explode_path(path):
Expand Down Expand Up @@ -353,8 +353,6 @@ def readlink(self):
"""
raise NotImplementedError

_copy_reader = property(CopyReader)

def copy(self, target, follow_symlinks=True, dirs_exist_ok=False,
preserve_metadata=False):
"""
Expand Down
5 changes: 2 additions & 3 deletions Lib/pathlib/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
except ImportError:
grp = None

from pathlib._os import LocalCopyReader, LocalCopyWriter, PathInfo, DirEntryInfo
from pathlib._os import LocalCopyWriter, PathInfo, DirEntryInfo, ensure_different_files


__all__ = [
Expand Down Expand Up @@ -1079,7 +1079,6 @@ def replace(self, target):
os.replace(self, target)
return self.with_segments(target)

_copy_reader = property(LocalCopyReader)
_copy_writer = property(LocalCopyWriter)

def copy(self, target, follow_symlinks=True, dirs_exist_ok=False,
Expand Down Expand Up @@ -1125,7 +1124,7 @@ def move(self, target):
else:
if not hasattr(target, '_copy_writer'):
target = self.with_segments(target_str)
target._copy_writer._ensure_different_file(self)
ensure_different_files(self, target)
try:
os.replace(self, target_str)
return target
Expand Down
Loading
Loading