--- a/configure.ac +++ b/configure.ac @@ -6827,7 +6827,7 @@ AS_CASE([$ac_sys_system], [AIX], [PY_STDLIB_MOD_SET_NA([_scproxy], [spwd])], [VxWorks*], [PY_STDLIB_MOD_SET_NA([_scproxy], [_crypt], [termios], [grp])], - [Darwin], [PY_STDLIB_MOD_SET_NA([ossaudiodev], [spwd])], + [Darwin], [PY_STDLIB_MOD_SET_NA([ossaudiodev], [spwd], [_posixsubprocess], [_scproxy], [_tkinter], [_xxsubinterpreters])], [CYGWIN*], [PY_STDLIB_MOD_SET_NA([_scproxy], [nis])], [QNX*], [PY_STDLIB_MOD_SET_NA([_scproxy], [nis])], [FreeBSD*], [PY_STDLIB_MOD_SET_NA([_scproxy], [spwd])], --- a/Lib/os.py +++ b/Lib/os.py @@ -605,6 +605,7 @@ fullname = path.join(dir, file) try: exec_func(fullname, *argrest) + return except (FileNotFoundError, NotADirectoryError) as e: last_exc = e except OSError as e: --- a/Lib/platform.py +++ b/Lib/platform.py @@ -607,7 +607,7 @@ default in case the command should fail. """ - if sys.platform in ('dos', 'win32', 'win16'): + if sys.platform in ('dos', 'win32', 'win16', 'darwin'): # XXX Others too ? return default --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -75,7 +75,7 @@ _mswindows = True # wasm32-emscripten and wasm32-wasi do not support processes -_can_fork_exec = sys.platform not in {"emscripten", "wasi"} +_can_fork_exec = sys.platform not in {"emscripten", "wasi", "darwin"} if _mswindows: import _winapi --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2624,11 +2624,9 @@ if sys.platform == 'darwin': - from _scproxy import _get_proxy_settings, _get_proxies def proxy_bypass_macosx_sysconf(host): - proxy_settings = _get_proxy_settings() - return _proxy_bypass_macosx_sysconf(host, proxy_settings) + return False def getproxies_macosx_sysconf(): """Return a dictionary of scheme -> proxy server URL mappings. @@ -2636,7 +2636,7 @@ This function uses the MacOSX framework SystemConfiguration to fetch the proxy information. """ - return _get_proxies() + return {} @@ -2649,9 +2649,9 @@ """ proxies = getproxies_environment() if proxies: - return proxy_bypass_environment(host, proxies) + return False else: - return proxy_bypass_macosx_sysconf(host) + return False def getproxies(): return getproxies_environment() or getproxies_macosx_sysconf() --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -71,6 +71,10 @@ #define MAX_GROUPS 64 #endif +#if defined(__APPLE__) +#include +#endif + #define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0) static struct PyModuleDef _posixsubprocessmodule; @@ -661,14 +665,25 @@ for (i = 0; exec_array[i] != NULL; ++i) { const char *executable = exec_array[i]; if (envp) { - execve(executable, argv, envp); +#if defined(TARGET_OS_TV) + saved_errno = ENOTSUP; +#elif defined(TARGET_OS_IOS) + saved_errno = execve(executable, argv, envp); +#endif + break; } else { - execv(executable, argv); +#if defined(TARGET_OS_TV) + saved_errno = ENOTSUP; +#elif defined(TARGET_OS_IOS) + saved_errno = execv(executable, argv); +#endif + break; } if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) { saved_errno = errno; } } + if (saved_errno == 0) return; /* Report the first exec error, not the last. */ if (saved_errno) errno = saved_errno; @@ -751,7 +766,12 @@ } else #endif { +#if defined(TARGET_OS_TV) + pid = -1; + errno = ENOTSUP; +#else pid = fork(); +#endif } if (pid != 0) { @@ -763,6 +783,7 @@ * the code below. */ +#if !defined(TARGET_OS_TV) if (preexec_fn != Py_None) { /* We'll be calling back into Python later so we need to do this. * This call may not be async-signal-safe but neither is calling @@ -779,6 +800,7 @@ call_setuid, uid, child_umask, child_sigmask, py_fds_to_keep, preexec_fn, preexec_fn_args_tuple); _exit(255); +#endif return 0; /* Dead code to avoid a potential compiler warning. */ } @@ -990,8 +1012,10 @@ preexec_fn_args_tuple = PyTuple_New(0); if (!preexec_fn_args_tuple) goto cleanup; +#if !defined(TARGET_OS_TV) PyOS_BeforeFork(); need_after_fork = 1; +#endif } /* NOTE: When old_sigmask is non-NULL, do_fork_exec() may use vfork(). */ @@ -1051,8 +1073,10 @@ } #endif +#if !defined(TARGET_OS_TV) if (need_after_fork) PyOS_AfterFork_Parent(); +#endif cleanup: if (saved_errno != 0) {