From 93a57fb92e08f4a388466bf1dc62dec940c3fbc6 Mon Sep 17 00:00:00 2001 From: Tommy Beadle Date: Thu, 2 Jun 2016 15:41:20 -0400 Subject: [PATCH] [Issue 24617] Add comment for os.makedirs about certain mode bits. --- Doc/library/os.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 1b0ad17..f757907 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1623,10 +1623,17 @@ features: Create a directory named *path* with numeric mode *mode*. + .. _mkdir_modebits: + On some systems, *mode* is ignored. Where it is used, the current umask value is first masked out. If the directory already exists, :exc:`FileExistsError` is raised. + If bits other than the last 9 (i.e. the last 3 digits of the octal + representation of the *mode*) are set, their meaning is platform-dependent. + On some platforms, they are ignored and you should call :func:`chmod` + explicitly to set them. + This function can also support :ref:`paths relative to directory descriptors `. @@ -1646,8 +1653,8 @@ features: Recursive directory creation function. Like :func:`mkdir`, but makes all intermediate-level directories needed to contain the leaf directory. - The default *mode* is ``0o777`` (octal). On some systems, *mode* is - ignored. Where it is used, the current umask value is first masked out. + See :ref:`here ` for more information about how *mode* is + interpreted. If *exist_ok* is ``False`` (the default), an :exc:`OSError` is raised if the target directory already exists. -- 2.8.2