jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python39 / patches / 23-sendfile-reenable.patch
blob89928bb3c2370d567a6961a653d09582b52121eb
1 All sendfile differences between Linux and Solaris were hopefully taken care
2 of, and hence we can reenable it within the shutil module.
4 This was requested upstream as well:
5 https://bugs.python.org/issue41843
7 --- Python-3.9.2/Lib/shutil.py
8 +++ Python-3.9.2/Lib/shutil.py
9 @@ -50,7 +50,7 @@ elif _WINDOWS:
10 import nt
12 COPY_BUFSIZE = 1024 * 1024 if _WINDOWS else 64 * 1024
13 -_USE_CP_SENDFILE = hasattr(os, "sendfile") and sys.platform.startswith("linux")
14 +_USE_CP_SENDFILE = hasattr(os, "sendfile")
15 _HAS_FCOPYFILE = posix and hasattr(posix, "_fcopyfile") # macOS
17 # CMD defaults in Windows 10
18 --- Python-3.9.2/Doc/library/shutil.rst
19 +++ Python-3.9.2/Doc/library/shutil.rst
20 @@ -453,7 +453,8 @@ the use of userspace buffers in Python a
22 On macOS `fcopyfile`_ is used to copy the file content (not metadata).
24 -On Linux :func:`os.sendfile` is used.
25 +On Linux, Solaris and other POSIX platforms where :func:`os.sendfile` supports
26 +copies between 2 regular file descriptors :func:`os.sendfile` is used.
28 On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB
29 instead of 64 KiB) and a :func:`memoryview`-based variant of