MCPcopy Index your code
hub / github.com/python/cpython / copy_into

Method copy_into

Lib/pathlib/__init__.py:1304–1315  ·  view source on GitHub ↗

Copy this file or directory tree into the given existing directory.

(self, target_dir, **kwargs)

Source from the content-addressed store, hash-verified

1302 return target.joinpath() # Empty join to ensure fresh metadata.
1303
1304 def copy_into(self, target_dir, **kwargs):
1305 """
1306 Copy this file or directory tree into the given existing directory.
1307 """
1308 name = self.name
1309 if not name:
1310 raise ValueError(f"{self!r} has an empty name")
1311 elif hasattr(target_dir, 'with_segments'):
1312 target = target_dir / name
1313 else:
1314 target = self.with_segments(target_dir, name)
1315 return self.copy(target, **kwargs)
1316
1317 def _copy_from(self, source, follow_symlinks=True, preserve_metadata=False):
1318 """

Callers 1

test_copy_intoMethod · 0.45

Calls 2

copyMethod · 0.95
with_segmentsMethod · 0.45

Tested by 1

test_copy_intoMethod · 0.36