$NetBSD: patch-Modules_posixmodule.c,v 1.1 2023/11/10 09:48:40 nia Exp $ posix.copyfile does not exist on Tiger. Python 3.8's posix._fcopyfile implementation unconditionally uses , which only exists on Leopard ane newer. This patch removes posix._fcopyfile on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile only conditionally after checking that the function exists (non-Apple systems don't have posix._fcopyfile either). thanks to @dgelessus https://github.com/macports/macports-ports/pull/5987 --- Modules/posixmodule.c.orig 2023-08-24 12:46:25.000000000 +0000 +++ Modules/posixmodule.c @@ -66,6 +66,8 @@ */ #if defined(__APPLE__) +#include + #if defined(__has_builtin) #if __has_builtin(__builtin_available) #define HAVE_BUILTIN_AVAILABLE 1 @@ -238,7 +240,7 @@ corresponding Unix manual entries for mo # include #endif -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 # include #endif @@ -9997,7 +9999,7 @@ done: #endif /* HAVE_SENDFILE */ -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 /*[clinic input] os._fcopyfile @@ -15440,7 +15442,7 @@ all_ins(PyObject *m) #endif #endif /* HAVE_EVENTFD && EFD_CLOEXEC */ -#if defined(__APPLE__) +#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1; #endif