diff options
author | 2019-02-24 15:46:40 -0800 | |
---|---|---|
committer | 2019-02-25 08:46:40 +0900 | |
commit | 3b0abb019662e42070f1d6f7e74440afb1808f03 (patch) | |
tree | f847d5d5ad51d242fb82b2171b382334ff79eb1b | |
parent | bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11... (diff) | |
download | cpython-3b0abb019662e42070f1d6f7e74440afb1808f03.tar.gz cpython-3b0abb019662e42070f1d6f7e74440afb1808f03.tar.bz2 cpython-3b0abb019662e42070f1d6f7e74440afb1808f03.zip |
bpo-33671: allow setting shutil.copyfile() bufsize globally (GH-12016)
-rw-r--r-- | Lib/shutil.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 065e08bc5c3..29e7564622e 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -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: |