mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-33671: allow setting shutil.copyfile() bufsize globally (GH-12016)
This commit is contained in:
parent
ef4ac967e2
commit
3b0abb0196
1 changed files with 3 additions and 1 deletions
|
@ -187,9 +187,11 @@ def _copyfileobj_readinto(fsrc, fdst, length=COPY_BUFSIZE):
|
|||
else:
|
||||
fdst_write(mv)
|
||||
|
||||
def copyfileobj(fsrc, fdst, length=COPY_BUFSIZE):
|
||||
def copyfileobj(fsrc, fdst, length=0):
|
||||
"""copy data from file-like object fsrc to file-like object fdst"""
|
||||
# Localize variable access to minimize overhead.
|
||||
if not length:
|
||||
length = COPY_BUFSIZE
|
||||
fsrc_read = fsrc.read
|
||||
fdst_write = fdst.write
|
||||
while True:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue