MCPcopy
hub / github.com/pytest-dev/pytest / copychunked

Function copychunked

src/_pytest/_py/path.py:1452–1466  ·  src/_pytest/_py/path.py::copychunked
(src, dest)

Source from the content-addressed store, hash-verified

1450
1451
1452def copychunked(src, dest):
1453 chunksize = 524288 class="cm"># half a meg of bytes
1454 fsrc = src.open(class="st">"rb")
1455 try:
1456 fdest = dest.open(class="st">"wb")
1457 try:
1458 while 1:
1459 buf = fsrc.read(chunksize)
1460 if not buf:
1461 break
1462 fdest.write(buf)
1463 finally:
1464 fdest.close()
1465 finally:
1466 fsrc.close()
1467
1468
1469def isimportable(name):

Callers 1

copyMethod · 0.85

Calls 4

openMethod · 0.80
readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected