[Python-checkins] cpython (merge 3.5 -> default): Issue #24617: Merge os.mkdir() doc from 3.5

martin.panter python-checkins at python.org
Fri Jun 10 04:49:20 EDT 2016


https://hg.python.org/cpython/rev/bfd77c6fc04f
changeset: 101848:bfd77c6fc04f
parent: 101847:55b2d262a89d
parent: 101846:e6093676e93b
user: Martin Panter <vadmium+py at gmail.com>
date: Fri Jun 10 08:40:02 2016 +0000
summary:
 Issue #24617: Merge os.mkdir() doc from 3.5
files:
 Doc/library/os.rst | 14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1656,9 +1656,15 @@
 
 Create a directory named *path* with numeric mode *mode*.
 
+ If the directory already exists, :exc:`FileExistsError` is raised.
+
+ .. _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.
+ value is first masked out. 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
 <dir_fd>`.
@@ -1679,8 +1685,8 @@
 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.
+ The *mode* parameter is passed to :func:`mkdir`; see :ref:`the mkdir()
+ description <mkdir_modebits>` for how it is interpreted.
 
 If *exist_ok* is ``False`` (the default), an :exc:`OSError` is raised if the
 target directory already exists.
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /