pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/lang
Module Name: pkgsrc
Committed By: adam
Date: Mon Sep 9 15:47:30 UTC 2024
Modified Files:
pkgsrc/lang/py38-html-docs: Makefile distinfo
pkgsrc/lang/python38: Makefile dist.mk distinfo
pkgsrc/lang/python38/patches: patch-Modules_posixmodule.c
Log Message:
python38 py38-html-docs: updated to 3.8.20
Python 3.8.20 final
Windows
gh-119690: Fixes data type confusion in audit events raised by _winapi.CreateFile and _winapi.CreateNamedPipe.
gh-116773: Fix instances of <_overlapped.Overlapped object at 0xXXX> still has pending operation at deallocation, the process may crash.
Tests
gh-112769: The tests now correctly compare zlib version when zlib.ZLIB_RUNTIME_VERSION contains non-integer suffixes. For example zlib-ng defines the version as 1.3.0.zlib-ng.
gh-117187: Fix XML tests for vanilla Expat <2.6.0.
Security
gh-123678: Upgrade libexpat to 2.6.3
gh-121957: Fixed missing audit events around interactive use of Python, now also properly firing for python -i, as well as for python -m asyncio. The event in question is cpython.run_stdin.
gh-122133: Authenticate the socket connection for the socket.socketpair() fallback on platforms where AF_UNIX is not available like Windows.
Patch by Gregory P. Smith <greg%krypto.org@localhost> and Seth Larson <seth%python.org@localhost>. Reported by Ellie <el%horse64.org@localhost>
gh-121285: Remove backtracking from tarfile header parsing for hdrcharset, PAX, and GNU sparse headers.
gh-118486: os.mkdir() on Windows now accepts mode of 0o700 to restrict the new directory to the current user. This fixes CVE-2024-4030 affecting tempfile.mkdtemp() in scenarios where the base
temporary directory is more permissive than the default.
gh-114572: ssl.SSLContext.cert_store_stats() and ssl.SSLContext.get_ca_certs() now correctly lock access to the certificate store, when the ssl.SSLContext is shared across multiple threads.
gh-116741: Update bundled libexpat to 2.6.2
Library
gh-123270: Applied a more surgical fix for malformed payloads in zipfile.Path causing infinite loops (gh-122905) without breaking contents using legitimate characters.
gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes by http.cookies.
gh-121650: email headers with embedded newlines are now quoted on output. The generator will now refuse to serialize (write) headers that are unsafely folded or delimited; see
verify_generated_headers. (Contributed by Bas Bloemsaat and Petr Viktorin in gh-121650.)
gh-113171: Fixed various false positives and false negatives in
ipaddress.IPv4Address.is_private (see these docs for details)
ipaddress.IPv4Address.is_global
ipaddress.IPv6Address.is_private
ipaddress.IPv6Address.is_global
Also in the corresponding ipaddress.IPv4Network and ipaddress.IPv6Network attributes.
gh-102988: email.utils.getaddresses() and email.utils.parseaddr() now return ('', '') 2-tuples in more situations where invalid email addresses are encountered instead of potentially inaccurate
values. Add optional strict parameter to these two functions: use strict=False to get the old behavior, accept malformed inputs. getattr(email.utils, 'supports_strict_parsing', False) can be use to
check if the strict paramater is available. Patch by Thomas Dwyer and Victor Stinner to improve the CVE-2023-27043 fix.
gh-67693: Fix urllib.parse.urlunparse() and urllib.parse.urlunsplit() for URIs with path starting with multiple slashes and no authority. Based on patch by Ashwin Ramaswami.
Core and Builtins
gh-112275: A deadlock involving pystate.c’s HEAD_LOCK in posixmodule.c at fork is now fixed. Patch by ChuBoning based on previous Python 3.12 fix by Victor Stinner.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 pkgsrc/lang/py38-html-docs/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/lang/py38-html-docs/distinfo
cvs rdiff -u -r1.40 -r1.41 pkgsrc/lang/python38/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/lang/python38/dist.mk
cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/python38/distinfo
cvs rdiff -u -r1.1 -r1.2 \
pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/lang/py38-html-docs/Makefile
diff -u pkgsrc/lang/py38-html-docs/Makefile:1.20 pkgsrc/lang/py38-html-docs/Makefile:1.21
--- pkgsrc/lang/py38-html-docs/Makefile:1.20 Wed Mar 20 15:39:02 2024
+++ pkgsrc/lang/py38-html-docs/Makefile Mon Sep 9 15:47:30 2024
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.20 2024/03/20 15:39:02 adam Exp $
+# $NetBSD: Makefile,v 1.21 2024/09/09 15:47:30 adam Exp $
-VERS= 3.8.19
+VERS= 3.8.20
DISTNAME= python-${VERS}-docs-html
PKGNAME= py38-html-docs-${VERS}
CATEGORIES= lang python
Index: pkgsrc/lang/py38-html-docs/distinfo
diff -u pkgsrc/lang/py38-html-docs/distinfo:1.22 pkgsrc/lang/py38-html-docs/distinfo:1.23
--- pkgsrc/lang/py38-html-docs/distinfo:1.22 Wed Mar 20 15:39:02 2024
+++ pkgsrc/lang/py38-html-docs/distinfo Mon Sep 9 15:47:30 2024
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.22 2024/03/20 15:39:02 adam Exp $
+$NetBSD: distinfo,v 1.23 2024/09/09 15:47:30 adam Exp $
-BLAKE2s (python-3.8.19-docs-html.tar.bz2) = 7ad5dde3db30ba1a968d9274a214928f679f507dafce28c290a3196dd2501fc8
-SHA512 (python-3.8.19-docs-html.tar.bz2) = 188e41b681c0ec823de89ad0d408473bd7baff80c8ab4d691e2c8b1308a89af63c1973b8a3dac676b8b3880786e741355f653e67150e8170c27798b43a3462df
-Size (python-3.8.19-docs-html.tar.bz2) = 6717842 bytes
+BLAKE2s (python-3.8.20-docs-html.tar.bz2) = 8a03d572aed962f082b6b061ea5b0138be1840c071d624faf9f5df5b0c0690a2
+SHA512 (python-3.8.20-docs-html.tar.bz2) = 0a77f0240d6d495a5099d4a95e151f38517730815e6f3d9b82964cf60be95b8bdc960916d317e19bb8e14a9604217cd1fa85703996aec972004a6a93d4ffa6d0
+Size (python-3.8.20-docs-html.tar.bz2) = 6727651 bytes
Index: pkgsrc/lang/python38/Makefile
diff -u pkgsrc/lang/python38/Makefile:1.40 pkgsrc/lang/python38/Makefile:1.41
--- pkgsrc/lang/python38/Makefile:1.40 Wed May 29 16:33:16 2024
+++ pkgsrc/lang/python38/Makefile Mon Sep 9 15:47:30 2024
@@ -1,6 +1,5 @@
-# $NetBSD: Makefile,v 1.40 2024/05/29 16:33:16 adam Exp $
+# $NetBSD: Makefile,v 1.41 2024/09/09 15:47:30 adam Exp $
-PKGREVISION= 1
.include "dist.mk"
PKGNAME= python38-${PY_DISTVERSION}
Index: pkgsrc/lang/python38/dist.mk
diff -u pkgsrc/lang/python38/dist.mk:1.20 pkgsrc/lang/python38/dist.mk:1.21
--- pkgsrc/lang/python38/dist.mk:1.20 Wed Mar 20 15:39:02 2024
+++ pkgsrc/lang/python38/dist.mk Mon Sep 9 15:47:30 2024
@@ -1,6 +1,6 @@
-# $NetBSD: dist.mk,v 1.20 2024/03/20 15:39:02 adam Exp $
+# $NetBSD: dist.mk,v 1.21 2024/09/09 15:47:30 adam Exp $
-PY_DISTVERSION= 3.8.19
+PY_DISTVERSION= 3.8.20
DISTNAME= Python-${PY_DISTVERSION}
EXTRACT_SUFX= .tar.xz
DISTINFO_FILE= ${.CURDIR}/../../lang/python38/distinfo
Index: pkgsrc/lang/python38/distinfo
diff -u pkgsrc/lang/python38/distinfo:1.34 pkgsrc/lang/python38/distinfo:1.35
--- pkgsrc/lang/python38/distinfo:1.34 Wed Mar 20 15:39:02 2024
+++ pkgsrc/lang/python38/distinfo Mon Sep 9 15:47:30 2024
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.34 2024/03/20 15:39:02 adam Exp $
+$NetBSD: distinfo,v 1.35 2024/09/09 15:47:30 adam Exp $
-BLAKE2s (Python-3.8.19.tar.xz) = 67b9eb01f7bb2023cd301e85884db238165bf8433d5b22c5f8ee523d24112da9
-SHA512 (Python-3.8.19.tar.xz) = 1d2a57fa15ccdaec8cdca508ba2ffb01e1ae053a3446ac709bc334480f8e913070899f01ed680cce6dc7ddfddcb27ef402fe206562249fa4c4e87be21ece0625
-Size (Python-3.8.19.tar.xz) = 18975156 bytes
+BLAKE2s (Python-3.8.20.tar.xz) = 9a56192b7ffad1f8af7bac5c44a96a2a8971f93d8133aa6f3af419e8356fe746
+SHA512 (Python-3.8.20.tar.xz) = 3c9341ee1fd33cb687958dcf2b7c0c7700489726c4d530c3e9d9537d46a6ab534541a4b312232d8505bea395a07e4518c42d75fb7571103e6b266f8f44115c61
+Size (Python-3.8.20.tar.xz) = 18962788 bytes
SHA1 (patch-Lib_ctypes_util.py) = 032cc99ebad93ddddfd89073c60424a952e3faa3
SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
SHA1 (patch-Lib_distutils_unixccompiler.py) = 2e65a8dd5dd3fe25957206c062106fa7a6fc4e69
@@ -11,7 +11,7 @@ SHA1 (patch-Lib_sysconfig.py) = a4f009ed
SHA1 (patch-Makefile.pre.in) = d42f9f5bca1dd663f64122dc95b49111452fe6e8
SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567
SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d
-SHA1 (patch-Modules_posixmodule.c) = ea24a1aa19b596b5d4457a4eff761e516406145f
+SHA1 (patch-Modules_posixmodule.c) = 47faf2ae2eb42c90ab25f94ac7542ae76f1ba172
SHA1 (patch-Modules_socketmodule.c) = 7adfdd0b6feaadb079c600093352fc023a8c4357
SHA1 (patch-Modules_socketmodule.h) = 9ba713069aeb4e262d0bf621e3873002a11f97bb
SHA1 (patch-Modules_timemodule.c) = 10dc2769432bbfd4360f90fedfa6504d8b6f6347
Index: pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c
diff -u pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c:1.1 pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c:1.2
--- pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c:1.1 Tue Nov 17 19:33:15 2020
+++ pkgsrc/lang/python38/patches/patch-Modules_posixmodule.c Mon Sep 9 15:47:30 2024
@@ -1,9 +1,9 @@
-$NetBSD: patch-Modules_posixmodule.c,v 1.1 2020/11/17 19:33:15 sjmulder Exp $
+$NetBSD: patch-Modules_posixmodule.c,v 1.2 2024/09/09 15:47:30 adam Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
---- Modules/posixmodule.c.orig 2020-09-23 12:36:32.000000000 +0000
+--- Modules/posixmodule.c.orig 2024-09-06 20:41:55.000000000 +0000
+++ Modules/posixmodule.c
@@ -8,20 +8,6 @@
of the compiler used. Different compilers define their own feature
@@ -26,7 +26,7 @@ https://github.com/python/cpython/pull/2
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-@@ -53,6 +39,127 @@
+@@ -60,6 +46,127 @@
#include <stdio.h> /* needed for ctermid() */
@@ -154,7 +154,7 @@ https://github.com/python/cpython/pull/2
#ifdef __cplusplus
extern "C" {
#endif
-@@ -2235,6 +2342,10 @@ posix_do_stat(const char *function_name,
+@@ -2261,6 +2368,10 @@ posix_do_stat(const char *function_name,
STRUCT_STAT st;
int result;
@@ -165,7 +165,7 @@ https://github.com/python/cpython/pull/2
#if !defined(MS_WINDOWS) && !defined(HAVE_FSTATAT) && !defined(HAVE_LSTAT)
if (follow_symlinks_specified(function_name, follow_symlinks))
return NULL;
-@@ -2261,15 +2372,27 @@ posix_do_stat(const char *function_name,
+@@ -2287,15 +2398,27 @@ posix_do_stat(const char *function_name,
else
#endif /* HAVE_LSTAT */
#ifdef HAVE_FSTATAT
@@ -196,7 +196,7 @@ https://github.com/python/cpython/pull/2
if (result != 0) {
return path_error(path);
}
-@@ -2692,6 +2815,10 @@ os_access_impl(PyObject *module, path_t
+@@ -2718,6 +2841,10 @@ os_access_impl(PyObject *module, path_t
int result;
#endif
@@ -207,7 +207,7 @@ https://github.com/python/cpython/pull/2
#ifndef HAVE_FACCESSAT
if (follow_symlinks_specified("access", follow_symlinks))
return -1;
-@@ -2726,17 +2853,40 @@ os_access_impl(PyObject *module, path_t
+@@ -2752,17 +2879,40 @@ os_access_impl(PyObject *module, path_t
if ((dir_fd != DEFAULT_DIR_FD) ||
effective_ids ||
!follow_symlinks) {
@@ -254,7 +254,7 @@ https://github.com/python/cpython/pull/2
return_value = !result;
#endif
-@@ -2923,6 +3073,7 @@ os_chmod_impl(PyObject *module, path_t *
+@@ -2949,6 +3099,7 @@ os_chmod_impl(PyObject *module, path_t *
#ifdef HAVE_FCHMODAT
int fchmodat_nofollow_unsupported = 0;
@@ -262,7 +262,7 @@ https://github.com/python/cpython/pull/2
#endif
#if !(defined(HAVE_FCHMODAT) || defined(HAVE_LCHMOD))
-@@ -2958,42 +3109,56 @@ os_chmod_impl(PyObject *module, path_t *
+@@ -2984,42 +3135,56 @@ os_chmod_impl(PyObject *module, path_t *
if (path->fd != -1)
result = fchmod(path->fd, mode);
else
@@ -342,7 +342,7 @@ https://github.com/python/cpython/pull/2
if (fchmodat_nofollow_unsupported) {
if (dir_fd != DEFAULT_DIR_FD)
dir_fd_and_follow_symlinks_invalid("chmod",
-@@ -3003,10 +3168,10 @@ os_chmod_impl(PyObject *module, path_t *
+@@ -3029,10 +3194,10 @@ os_chmod_impl(PyObject *module, path_t *
return NULL;
}
else
@@ -355,7 +355,7 @@ https://github.com/python/cpython/pull/2
Py_RETURN_NONE;
}
-@@ -3294,6 +3459,10 @@ os_chown_impl(PyObject *module, path_t *
+@@ -3320,6 +3485,10 @@ os_chown_impl(PyObject *module, path_t *
{
int result;
@@ -366,7 +366,7 @@ https://github.com/python/cpython/pull/2
#if !(defined(HAVE_LCHOWN) || defined(HAVE_FCHOWNAT))
if (follow_symlinks_specified("chown", follow_symlinks))
return NULL;
-@@ -3302,19 +3471,6 @@ os_chown_impl(PyObject *module, path_t *
+@@ -3328,19 +3497,6 @@ os_chown_impl(PyObject *module, path_t *
fd_and_follow_symlinks_invalid("chown", path->fd, follow_symlinks))
return NULL;
@@ -386,7 +386,7 @@ https://github.com/python/cpython/pull/2
if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
return NULL;
-@@ -3332,14 +3488,28 @@ os_chown_impl(PyObject *module, path_t *
+@@ -3358,14 +3514,28 @@ os_chown_impl(PyObject *module, path_t *
else
#endif
#ifdef HAVE_FCHOWNAT
@@ -417,7 +417,7 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error(path);
-@@ -3585,6 +3755,9 @@ os_link_impl(PyObject *module, path_t *s
+@@ -3611,6 +3781,9 @@ os_link_impl(PyObject *module, path_t *s
#else
int result;
#endif
@@ -427,7 +427,7 @@ https://github.com/python/cpython/pull/2
#ifndef HAVE_LINKAT
if ((src_dir_fd != DEFAULT_DIR_FD) || (dst_dir_fd != DEFAULT_DIR_FD)) {
-@@ -3619,15 +3792,43 @@ os_link_impl(PyObject *module, path_t *s
+@@ -3645,15 +3818,43 @@ os_link_impl(PyObject *module, path_t *s
#ifdef HAVE_LINKAT
if ((src_dir_fd != DEFAULT_DIR_FD) ||
(dst_dir_fd != DEFAULT_DIR_FD) ||
@@ -475,7 +475,7 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error2(src, dst);
#endif /* MS_WINDOWS */
-@@ -3750,6 +3951,7 @@ _posix_listdir(path_t *path, PyObject *l
+@@ -3776,6 +3977,7 @@ _posix_listdir(path_t *path, PyObject *l
errno = 0;
#ifdef HAVE_FDOPENDIR
if (path->fd != -1) {
@@ -483,7 +483,7 @@ https://github.com/python/cpython/pull/2
/* closedir() closes the FD, so we duplicate it */
fd = _Py_dup(path->fd);
if (fd == -1)
-@@ -3760,6 +3962,11 @@ _posix_listdir(path_t *path, PyObject *l
+@@ -3786,6 +3988,11 @@ _posix_listdir(path_t *path, PyObject *l
Py_BEGIN_ALLOW_THREADS
dirp = fdopendir(fd);
Py_END_ALLOW_THREADS
@@ -495,17 +495,17 @@ https://github.com/python/cpython/pull/2
}
else
#endif
-@@ -4077,6 +4284,9 @@ os_mkdir_impl(PyObject *module, path_t *
- /*[clinic end generated code: output=a70446903abe821f input=e965f68377e9b1ce]*/
- {
- int result;
+@@ -4162,6 +4369,9 @@ os_mkdir_impl(PyObject *module, path_t *
+ SECURITY_ATTRIBUTES secAttr = { sizeof(secAttr) };
+ SECURITY_ATTRIBUTES *pSecAttr = NULL;
+ #endif
+#ifdef HAVE_MKDIRAT
+ int mkdirat_unavailable = 0;
+#endif
if (PySys_Audit("os.mkdir", "Oii", path->object, mode,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
-@@ -4093,9 +4303,14 @@ os_mkdir_impl(PyObject *module, path_t *
+@@ -4205,9 +4415,13 @@ os_mkdir_impl(PyObject *module, path_t *
#else
Py_BEGIN_ALLOW_THREADS
#if HAVE_MKDIRAT
@@ -514,15 +514,14 @@ https://github.com/python/cpython/pull/2
+ if (HAVE_MKDIRAT_RUNTIME) {
result = mkdirat(dir_fd, path->narrow, mode);
- else
-+
+ } else {
+ mkdirat_unavailable = 1;
+ }
-+ } else
++ } else
#endif
#if defined(__WATCOMC__) && !defined(__QNX__)
result = mkdir(path->narrow);
-@@ -4103,6 +4318,14 @@ os_mkdir_impl(PyObject *module, path_t *
+@@ -4215,6 +4429,14 @@ os_mkdir_impl(PyObject *module, path_t *
result = mkdir(path->narrow, mode);
#endif
Py_END_ALLOW_THREADS
@@ -537,18 +536,17 @@ https://github.com/python/cpython/pull/2
if (result < 0)
return path_error(path);
#endif /* MS_WINDOWS */
-@@ -4212,6 +4435,10 @@ internal_rename(path_t *src, path_t *dst
+@@ -4323,6 +4545,9 @@ internal_rename(path_t *src, path_t *dst
+ {
const char *function_name = is_replace ? "replace" : "rename";
int dir_fd_specified;
-
+#ifdef HAVE_RENAMEAT
+ int renameat_unavailable = 0;
+#endif
-+
+
#ifdef MS_WINDOWS
BOOL result;
- int flags = is_replace ? MOVEFILE_REPLACE_EXISTING : 0;
-@@ -4251,13 +4478,25 @@ internal_rename(path_t *src, path_t *dst
+@@ -4363,13 +4588,24 @@ internal_rename(path_t *src, path_t *dst
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_RENAMEAT
@@ -556,7 +554,7 @@ https://github.com/python/cpython/pull/2
- result = renameat(src_dir_fd, src->narrow, dst_dir_fd, dst->narrow);
- else
+ if (dir_fd_specified) {
-+ if (HAVE_RENAMEAT_RUNTIME) {
++ if (HAVE_RENAMEAT_RUNTIME) {
+ result = renameat(src_dir_fd, src->narrow, dst_dir_fd, dst->narrow);
+ } else {
+ renameat_unavailable = 1;
@@ -566,7 +564,6 @@ https://github.com/python/cpython/pull/2
result = rename(src->narrow, dst->narrow);
Py_END_ALLOW_THREADS
-+
+#ifdef HAVE_RENAMEAT
+ if (renameat_unavailable) {
+ argument_unavailable_error(function_name, "src_dir_fd and dst_dir_fd");
@@ -577,7 +574,7 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error2(src, dst);
#endif
-@@ -4333,6 +4572,9 @@ os_rmdir_impl(PyObject *module, path_t *
+@@ -4445,6 +4681,9 @@ os_rmdir_impl(PyObject *module, path_t *
/*[clinic end generated code: output=080eb54f506e8301 input=38c8b375ca34a7e2]*/
{
int result;
@@ -587,7 +584,7 @@ https://github.com/python/cpython/pull/2
if (PySys_Audit("os.rmdir", "Oi", path->object,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
-@@ -4345,14 +4587,26 @@ os_rmdir_impl(PyObject *module, path_t *
+@@ -4457,14 +4696,26 @@ os_rmdir_impl(PyObject *module, path_t *
result = !RemoveDirectoryW(path->wide);
#else
#ifdef HAVE_UNLINKAT
@@ -616,7 +613,7 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error(path);
-@@ -4496,6 +4750,9 @@ os_unlink_impl(PyObject *module, path_t
+@@ -4608,6 +4859,9 @@ os_unlink_impl(PyObject *module, path_t
/*[clinic end generated code: output=621797807b9963b1 input=d7bcde2b1b2a2552]*/
{
int result;
@@ -626,14 +623,13 @@ https://github.com/python/cpython/pull/2
if (PySys_Audit("os.remove", "Oi", path->object,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
-@@ -4509,15 +4766,27 @@ os_unlink_impl(PyObject *module, path_t
+@@ -4621,15 +4875,26 @@ os_unlink_impl(PyObject *module, path_t
result = !Py_DeleteFileW(path->wide);
#else
#ifdef HAVE_UNLINKAT
- if (dir_fd != DEFAULT_DIR_FD)
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_UNLINKAT_RUNTIME) {
-+
result = unlinkat(dir_fd, path->narrow, 0);
- else
+ } else {
@@ -656,12 +652,12 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error(path);
-@@ -4690,7 +4959,16 @@ typedef struct {
+@@ -4802,7 +5067,16 @@ typedef struct {
static int
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
{
-#ifdef HAVE_UTIMENSAT
-+#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
++#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
+ if (HAVE_UTIMENSAT_RUNTIME) {
+ int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
+ UTIME_TO_TIMESPEC;
@@ -674,17 +670,14 @@ https://github.com/python/cpython/pull/2
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
UTIME_TO_TIMESPEC;
return utimensat(dir_fd, path, time, flags);
-@@ -4717,11 +4995,30 @@ static int
+@@ -4829,11 +5103,26 @@ static int
utime_fd(utime_t *ut, int fd)
{
#ifdef HAVE_FUTIMENS
-+
-+ if (HAVE_FUTIMENS_RUNTIME) {
-+
++ if (HAVE_FUTIMENS_RUNTIME) {
UTIME_TO_TIMESPEC;
return futimens(fd, time);
-#else
-+
+ } else
+#ifndef HAVE_FUTIMES
+ {
@@ -696,7 +689,6 @@ https://github.com/python/cpython/pull/2
+ return -1;
+ }
+#endif
-+
+#endif
+#ifdef HAVE_FUTIMES
+ {
@@ -706,7 +698,7 @@ https://github.com/python/cpython/pull/2
#endif
}
-@@ -4740,11 +5037,27 @@ static int
+@@ -4852,11 +5141,27 @@ static int
utime_nofollow_symlinks(utime_t *ut, const char *path)
{
#ifdef HAVE_UTIMENSAT
@@ -737,7 +729,7 @@ https://github.com/python/cpython/pull/2
#endif
}
-@@ -4755,7 +5068,15 @@ utime_nofollow_symlinks(utime_t *ut, con
+@@ -4867,7 +5172,15 @@ utime_nofollow_symlinks(utime_t *ut, con
static int
utime_default(utime_t *ut, const char *path)
{
@@ -754,20 +746,7 @@ https://github.com/python/cpython/pull/2
UTIME_TO_TIMESPEC;
return utimensat(DEFAULT_DIR_FD, path, time, 0);
#elif defined(HAVE_UTIMES)
-@@ -4964,9 +5285,10 @@ os_utime_impl(PyObject *module, path_t *
- #endif
-
- #if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT)
-- if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks))
-+ if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
- result = utime_dir_fd(&utime, dir_fd, path->narrow, follow_symlinks);
-- else
-+
-+ } else
- #endif
-
- #if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS)
-@@ -4979,6 +5301,14 @@ os_utime_impl(PyObject *module, path_t *
+@@ -5091,6 +5404,14 @@ os_utime_impl(PyObject *module, path_t *
Py_END_ALLOW_THREADS
@@ -782,32 +761,31 @@ https://github.com/python/cpython/pull/2
if (result < 0) {
/* see previous comment about not putting filename in error here */
posix_error();
-@@ -5377,6 +5707,9 @@ parse_posix_spawn_flags(const char *func
+@@ -5489,6 +5810,9 @@ parse_posix_spawn_flags(const char *func
}
if (setsid) {
+#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
-+ if (HAVE_POSIX_SPAWN_SETSID_RUNTIME) {
++ if (HAVE_POSIX_SPAWN_SETSID_RUNTIME) {
+#endif
#ifdef POSIX_SPAWN_SETSID
all_flags |= POSIX_SPAWN_SETSID;
#elif defined(POSIX_SPAWN_SETSID_NP)
-@@ -5385,6 +5718,14 @@ parse_posix_spawn_flags(const char *func
+@@ -5497,6 +5821,13 @@ parse_posix_spawn_flags(const char *func
argument_unavailable_error(func_name, "setsid");
return -1;
#endif
+
+#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
-+ } else {
-+ argument_unavailable_error(func_name, "setsid");
-+ return -1;
-+ }
++ } else {
++ argument_unavailable_error(func_name, "setsid");
++ return -1;
++ }
+#endif /* HAVE_POSIX_SPAWN_SETSID_RUNTIME */
-+
}
if (setsigmask) {
-@@ -7931,16 +8272,30 @@ os_readlink_impl(PyObject *module, path_
+@@ -8043,16 +8374,30 @@ os_readlink_impl(PyObject *module, path_
#if defined(HAVE_READLINK)
char buffer[MAXPATHLEN+1];
ssize_t length;
@@ -841,7 +819,7 @@ https://github.com/python/cpython/pull/2
if (length < 0) {
return path_error(path);
}
-@@ -8136,6 +8491,9 @@ os_symlink_impl(PyObject *module, path_t
+@@ -8248,6 +8593,9 @@ os_symlink_impl(PyObject *module, path_t
static int windows_has_symlink_unprivileged_flag = TRUE;
#else
int result;
@@ -851,15 +829,13 @@ https://github.com/python/cpython/pull/2
#endif
if (PySys_Audit("os.symlink", "OOi", src->object, dst->object,
-@@ -8198,14 +8556,25 @@ os_symlink_impl(PyObject *module, path_t
- }
+@@ -8311,13 +8659,24 @@ os_symlink_impl(PyObject *module, path_t
Py_BEGIN_ALLOW_THREADS
--#if HAVE_SYMLINKAT
+ #if HAVE_SYMLINKAT
- if (dir_fd != DEFAULT_DIR_FD)
- result = symlinkat(src->narrow, dir_fd, dst->narrow);
- else
-+#ifdef HAVE_SYMLINKAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_SYMLINKAT_RUNTIME) {
+ result = symlinkat(src->narrow, dir_fd, dst->narrow);
@@ -881,7 +857,7 @@ https://github.com/python/cpython/pull/2
if (result)
return path_error2(src, dst);
#endif
-@@ -8477,6 +8846,9 @@ os_open_impl(PyObject *module, path_t *p
+@@ -8589,6 +8948,9 @@ os_open_impl(PyObject *module, path_t *p
{
int fd;
int async_err = 0;
@@ -891,7 +867,7 @@ https://github.com/python/cpython/pull/2
#ifdef O_CLOEXEC
int *atomic_flag_works = &_Py_open_cloexec_works;
-@@ -8501,9 +8873,15 @@ os_open_impl(PyObject *module, path_t *p
+@@ -8613,9 +8975,15 @@ os_open_impl(PyObject *module, path_t *p
fd = _wopen(path->wide, flags, mode);
#else
#ifdef HAVE_OPENAT
@@ -910,7 +886,7 @@ https://github.com/python/cpython/pull/2
#endif /* HAVE_OPENAT */
fd = open(path->narrow, flags, mode);
#endif /* !MS_WINDOWS */
-@@ -8511,6 +8889,13 @@ os_open_impl(PyObject *module, path_t *p
+@@ -8623,6 +8991,13 @@ os_open_impl(PyObject *module, path_t *p
} while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
_Py_END_SUPPRESS_IPH
@@ -924,10 +900,10 @@ https://github.com/python/cpython/pull/2
if (fd < 0) {
if (!async_err)
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
-@@ -9081,12 +9466,25 @@ os_preadv_impl(PyObject *module, int fd,
+@@ -9192,6 +9567,14 @@ os_preadv_impl(PyObject *module, int fd,
+ Py_END_ALLOW_THREADS
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
#else
- do {
+#ifdef __APPLE__
+/* This entire function will be removed from the module dict when the API
+ * is not available.
@@ -936,25 +912,23 @@ https://github.com/python/cpython/pull/2
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+#endif
+ do {
Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH
- n = preadv(fd, iov, cnt, offset);
+@@ -9199,6 +9582,9 @@ os_preadv_impl(PyObject *module, int fd,
_Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
} while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
-+
+#ifdef __APPLE__
+#pragma clang diagnostic pop
+#endif
-+
#endif
iov_cleanup(iov, buf, cnt);
-@@ -9651,6 +10049,15 @@ os_pwritev_impl(PyObject *module, int fd
+@@ -9781,6 +10167,14 @@ os_pwritev_impl(PyObject *module, int fd
Py_END_ALLOW_THREADS
} while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
#else
-+
+#ifdef __APPLE__
+/* This entire function will be removed from the module dict when the API
+ * is not available.
@@ -966,19 +940,17 @@ https://github.com/python/cpython/pull/2
do {
Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH
-@@ -9658,6 +10065,11 @@ os_pwritev_impl(PyObject *module, int fd
+@@ -9788,6 +10182,9 @@ os_pwritev_impl(PyObject *module, int fd
_Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
} while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
-+
+#ifdef __APPLE__
+#pragma clang diagnostic pop
+#endif
-+
#endif
iov_cleanup(iov, buf, cnt);
-@@ -10553,13 +10965,6 @@ os_statvfs_impl(PyObject *module, path_t
+@@ -10683,13 +11080,6 @@ os_statvfs_impl(PyObject *module, path_t
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_FSTATVFS
if (path->fd != -1) {
@@ -992,7 +964,7 @@ https://github.com/python/cpython/pull/2
result = fstatvfs(path->fd, &st);
}
else
-@@ -12617,12 +13022,16 @@ DirEntry_fetch_stat(DirEntry *self, int
+@@ -12747,12 +13137,16 @@ DirEntry_fetch_stat(DirEntry *self, int
const char *path = PyBytes_AS_STRING(ub);
if (self->dir_fd != DEFAULT_DIR_FD) {
#ifdef HAVE_FSTATAT
@@ -1011,7 +983,7 @@ https://github.com/python/cpython/pull/2
}
else
#endif
-@@ -13428,6 +13837,7 @@ os_scandir_impl(PyObject *module, path_t
+@@ -13558,6 +13952,7 @@ os_scandir_impl(PyObject *module, path_t
errno = 0;
#ifdef HAVE_FDOPENDIR
if (path->fd != -1) {
@@ -1019,7 +991,7 @@ https://github.com/python/cpython/pull/2
/* closedir() closes the FD, so we duplicate it */
fd = _Py_dup(path->fd);
if (fd == -1)
-@@ -13436,6 +13846,11 @@ os_scandir_impl(PyObject *module, path_t
+@@ -13566,6 +13961,11 @@ os_scandir_impl(PyObject *module, path_t
Py_BEGIN_ALLOW_THREADS
iterator->dirp = fdopendir(fd);
Py_END_ALLOW_THREADS
@@ -1031,12 +1003,11 @@ https://github.com/python/cpython/pull/2
}
else
#endif
-@@ -14425,137 +14840,210 @@ static struct PyModuleDef posixmodule =
+@@ -14556,137 +14956,205 @@ static struct PyModuleDef posixmodule =
};
-static const char * const have_functions[] = {
-+
+#define PROBE(name, test) \
+ static int name(void) \
+ { \
@@ -1078,7 +1049,7 @@ https://github.com/python/cpython/pull/2
+#ifdef HAVE_RENAMEAT
+PROBE(probe_renameat, HAVE_RENAMEAT_RUNTIME)
+#endif
-+
+
+#ifdef HAVE_UNLINKAT
+PROBE(probe_unlinkat, HAVE_UNLINKAT_RUNTIME)
+#endif
@@ -1103,14 +1074,10 @@ https://github.com/python/cpython/pull/2
+PROBE(probe_utimensat, HAVE_UTIMENSAT_RUNTIME)
+#endif
+
-+
-+
-+
+static const struct have_function {
+ const char * const label;
+ int (*probe)(void);
+} have_functions[] = {
-
#ifdef HAVE_FACCESSAT
- "HAVE_FACCESSAT",
+ { "HAVE_FACCESSAT", probe_faccessat },
@@ -1272,11 +1239,11 @@ https://github.com/python/cpython/pull/2
#endif
- NULL
-+ { NULL, NULL }
++ { NULL, NULL },
};
-@@ -14564,12 +15052,28 @@ INITFUNC(void)
+@@ -14695,12 +15163,28 @@ INITFUNC(void)
{
PyObject *m, *v;
PyObject *list;
@@ -1306,52 +1273,16 @@ https://github.com/python/cpython/pull/2
/* Initialize environ dictionary */
v = convertenviron();
Py_XINCREF(v);
-@@ -14676,44 +15180,6 @@ INITFUNC(void)
+@@ -14807,7 +15291,7 @@ INITFUNC(void)
}
PyModule_AddObject(m, "uname_result", (PyObject *)UnameResultType);
-#ifdef __APPLE__
-- /*
-- * Step 2 of weak-linking support on Mac OS X.
-- *
-- * The code below removes functions that are not available on the
-- * currently active platform.
-- *
-- * This block allow one to use a python binary that was build on
-- * OSX 10.4 on OSX 10.3, without losing access to new APIs on
-- * OSX 10.4.
-- */
--#ifdef HAVE_FSTATVFS
-- if (fstatvfs == NULL) {
-- if (PyObject_DelAttrString(m, "fstatvfs") == -1) {
-- return NULL;
-- }
-- }
--#endif /* HAVE_FSTATVFS */
--
--#ifdef HAVE_STATVFS
-- if (statvfs == NULL) {
-- if (PyObject_DelAttrString(m, "statvfs") == -1) {
-- return NULL;
-- }
-- }
--#endif /* HAVE_STATVFS */
--
--# ifdef HAVE_LCHOWN
-- if (lchown == NULL) {
-- if (PyObject_DelAttrString(m, "lchown") == -1) {
-- return NULL;
-- }
-- }
--#endif /* HAVE_LCHOWN */
--
--
--#endif /* __APPLE__ */
--
- Py_INCREF(TerminalSizeType);
- PyModule_AddObject(m, "terminal_size", (PyObject*)TerminalSizeType);
-
-@@ -14738,14 +15204,17 @@ INITFUNC(void)
++#if 0
+ /*
+ * Step 2 of weak-linking support on Mac OS X.
+ *
+@@ -14869,8 +15353,10 @@ INITFUNC(void)
list = PyList_New(0);
if (!list)
return NULL;
@@ -1364,10 +1295,3 @@ https://github.com/python/cpython/pull/2
if (!unicode)
return NULL;
if (PyList_Append(list, unicode))
- return NULL;
- Py_DECREF(unicode);
- }
-+
- PyModule_AddObject(m, "_have_functions", list);
-
- Py_INCREF((PyObject *) &DirEntryType);
Home |
Main Index |
Thread Index |
Old Index