@@ -505,7 +505,7 @@ static const unsigned int _Py_STATX_KNOWN = (STATX_BASIC_STATS | STATX_BTIME
505505# define HAVE_UNLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
506506# define HAVE_OPENAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
507507# define HAVE_READLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
508- # define HAVE_FREADLINK_RUNTIME __builtin_available(macOS 13.0, *)
508+ # define HAVE_FREADLINK_RUNTIME __builtin_available(macOS 13.0, iOS 16.0, *)
509509# define HAVE_SYMLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
510510# define HAVE_FUTIMENS_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
511511# define HAVE_UTIMENSAT_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
@@ -11009,22 +11009,13 @@ that directory.
1100911009dir_fd may not be implemented on your platform. If it is unavailable,
1101011010using it will raise a NotImplementedError.
1101111011
11012- On Linux, Android and macOS, path may be a file descriptor referring to
11013- a symlink. If it is, dir_fd must be None, and the return value will be a
11014- string object. (File descriptors for symlinks can be obtained with
11015-
11016- os.open(..., os.O_RDONLY | os.O_PATH | os.O_NOFOLLOW)
11017-
11018- on Linux and Android, and:
11019-
11020- os.open(..., os.O_RDONLY | os.O_SYMLINK)
11021-
11022- on macOS.)
11012+ On Linux, Android, macOS and iOS, path may be a file descriptor
11013+ referring to a symlink. If it is, dir_fd must be None.
1102311014[clinic start generated code]*/
1102411015
1102511016static PyObject *
1102611017os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
11027- /*[clinic end generated code: output=d21b732a2e814030 input=14546747b3db62f6 ]*/
11018+ /*[clinic end generated code: output=d21b732a2e814030 input=d90bddfeee86f673 ]*/
1102811019{
1102911020#if defined(HAVE_READLINK)
1103011021 char buffer[MAXPATHLEN+1];
@@ -11079,10 +11070,12 @@ os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
1107911070 }
1108011071 buffer[length] = '\0';
1108111072
11082- if (path->is_fd || PyUnicode_Check(path->object))
11073+ if (path->is_fd || PyUnicode_Check(path->object)) {
1108311074 return PyUnicode_DecodeFSDefaultAndSize(buffer, length);
11084- else
11075+ }
11076+ else {
1108511077 return PyBytes_FromStringAndSize(buffer, length);
11078+ }
1108611079#elif defined(MS_WINDOWS)
1108711080 DWORD n_bytes_returned;
1108811081 DWORD io_result = 0;
0 commit comments