From 7ac07811de81a1823dd3af5480e7f69d495b67b9 Mon Sep 17 00:00:00 2001 From: Hagai Helman Tov Date: Thu, 25 Aug 2022 17:54:50 +0300 Subject: [PATCH 1/2] Add a sentence to `os.mkdir`'s docstring. --- Modules/clinic/posixmodule.c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index a26cb8261083a9..e94e03052fbd1f 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -1849,7 +1849,8 @@ PyDoc_STRVAR(os_mkdir__doc__, "dir_fd may not be implemented on your platform.\n" " If it is unavailable, using it will raise a NotImplementedError.\n" "\n" -"The mode argument is ignored on Windows."); +"The mode argument is ignored on Windows. Where it is used, the current umask\n" +"value is first masked out."); #define OS_MKDIR_METHODDEF \ {"mkdir", _PyCFunction_CAST(os_mkdir), METH_FASTCALL|METH_KEYWORDS, os_mkdir__doc__}, From ff2eef1355f5f5a9cc328c25fcb2b0cedd24042c Mon Sep 17 00:00:00 2001 From: Hagai Helman Tov Date: Thu, 25 Aug 2022 23:03:56 +0300 Subject: [PATCH 2/2] Move the docstring change to the clinic input. --- Modules/clinic/posixmodule.c.h | 2 +- Modules/posixmodule.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index e94e03052fbd1f..ef69a8483ec6cc 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -11368,4 +11368,4 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=dc71eece3fc988a7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9e6fc32ea9161d8e input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d45fa231ae5e2a..c4e2dd3989e85e 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4530,12 +4530,13 @@ If dir_fd is not None, it should be a file descriptor open to a directory, dir_fd may not be implemented on your platform. If it is unavailable, using it will raise a NotImplementedError. -The mode argument is ignored on Windows. +The mode argument is ignored on Windows. Where it is used, the current umask +value is first masked out. [clinic start generated code]*/ static PyObject * os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd) -/*[clinic end generated code: output=a70446903abe821f input=e965f68377e9b1ce]*/ +/*[clinic end generated code: output=a70446903abe821f input=a61722e1576fab03]*/ { int result; #ifdef HAVE_MKDIRAT