MCPcopy Index your code
hub / github.com/RustPython/RustPython / _copy_from_file

Method _copy_from_file

Lib/pathlib/__init__.py:1136–1142  ·  view source on GitHub ↗
(self, source, preserve_metadata=False)

Source from the content-addressed store, hash-verified

1134 self._copy_from_file(source, preserve_metadata)
1135
1136 def _copy_from_file(self, source, preserve_metadata=False):
1137 ensure_different_files(source, self)
1138 with magic_open(source, 'rb') as source_f:
1139 with open(self, 'wb') as target_f:
1140 copyfileobj(source_f, target_f)
1141 if preserve_metadata:
1142 copy_info(source.info, self)
1143
1144 if copyfile2:
1145 # Use fast OS routine for local file copying where available.

Callers 1

_copy_fromMethod · 0.95

Calls 7

ensure_different_filesFunction · 0.90
magic_openFunction · 0.90
copyfileobjFunction · 0.90
copy_infoFunction · 0.90
copyfile2Function · 0.90
strFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected