diff --git a/core/utils/__init__.py b/core/utils/__init__.py index 136cd5e0..f4ae2ffe 100644 --- a/core/utils/__init__.py +++ b/core/utils/__init__.py @@ -1,6 +1,5 @@ import requests -from core.utils import shutil_custom from core.utils.common import clean_dir, flatten, get_dirs, process_dir from core.utils.download_info import get_download_info, update_download_info_status from core.utils.encoding import char_replace, convert_to_ascii @@ -42,4 +41,3 @@ from core.utils.paths import ( from core.utils.processes import RunningProcess, restart requests.packages.urllib3.disable_warnings() -shutil_custom.monkey_patch() diff --git a/core/utils/shutil_custom.py b/core/utils/shutil_custom.py deleted file mode 100644 index a6cb3af8..00000000 --- a/core/utils/shutil_custom.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import ( - absolute_import, - division, - print_function, - unicode_literals, -) - -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)