From: Jelle Zijlstra Date: Sat, 8 Oct 2022 04:00:00 +0000 (-0700) Subject: [3.11] gh-96288: Add a sentence to `os.mkdir`'s docstring. (GH-96271). (#98065) X-Git-Tag: v3.11.1~317 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15732114b8a110668baf982e00ffb26081a8bac9;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-96288: Add a sentence to `os.mkdir`'s docstring. (GH-96271). (#98065) (cherry picked from commit 1523c9e9d47e7d67e4889987ff0f38eb7b881fdd) Co-authored-by: Hagai Helman Tov --- diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index e636f8b94ff7..b66cd857e449 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -1360,7 +1360,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__}, @@ -9378,4 +9379,4 @@ exit: #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=836be9d51f01140e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8dd784bf1e41b881 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4bebbbd06c19..a45179f6a1fa 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4560,12 +4560,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