mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 05:13:16 -07:00
Fix shutil.copyfileobj monkey patching
This commit is contained in:
parent
a6d2c6e96f
commit
5c644890e8
2 changed files with 13 additions and 9 deletions
11
core/utils/shutil_custom.py
Normal file
11
core/utils/shutil_custom.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from functools import partial
|
||||
import shutil
|
||||
from six import PY2
|
||||
|
||||
|
||||
def monkey_patch(length=512 * 1024):
|
||||
if PY2:
|
||||
# On Python 2 monkey patch shutil.copyfileobj()
|
||||
# to adjust the buffer length to 512KB rather than 4KB
|
||||
original_copyfileobj = shutil.copyfileobj
|
||||
shutil.copyfileobj = partial(original_copyfileobj, length=length)
|
Loading…
Add table
Add a link
Reference in a new issue