From 51e390d6e55554697c72152ee04fe422228b2dd8 Mon Sep 17 00:00:00 2001 From: Labrys of Knossos Date: Sat, 3 Dec 2022 00:52:01 -0500 Subject: [PATCH] Remove shutil_custom monkeypatch --- core/utils/__init__.py | 2 -- core/utils/shutil_custom.py | 18 ------------------ 2 files changed, 20 deletions(-) delete mode 100644 core/utils/shutil_custom.py 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)