Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 101591e

Browse files
committed
Merge 3.2
2 parents 042fa65 + 0230b6a commit 101591e

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

Doc/library/os.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,18 +1555,21 @@ features:
15551555
single: UNC paths; and os.makedirs()
15561556

15571557
Recursive directory creation function. Like :func:`mkdir`, but makes all
1558-
intermediate-level directories needed to contain the leaf directory. If
1559-
the target directory with the same mode as specified already exists,
1560-
raises an :exc:`OSError` exception if *exist_ok* is False, otherwise no
1561-
exception is raised. If the directory cannot be created in other cases,
1562-
raises an :exc:`OSError` exception. The default *mode* is ``0o777`` (octal).
1563-
On some systems, *mode* is ignored. Where it is used, the current umask
1564-
value is first masked out.
1558+
intermediate-level directories needed to contain the leaf directory.
1559+
1560+
The default *mode* is ``0o777`` (octal). On some systems, *mode* is
1561+
ignored. Where it is used, the current umask value is first masked out.
1562+
1563+
If *exists_ok* is ``False`` (the default), an :exc:`OSError` is raised if
1564+
the target directory already exists. If *exists_ok* is ``True`` an
1565+
:exc:`OSError` is still raised if the umask-masked *mode* is different from
1566+
the existing mode, on systems where the mode is used. :exc:`OSError` will
1567+
also be raised if the directory creation fails.
15651568

15661569
.. note::
15671570

15681571
:func:`makedirs` will become confused if the path elements to create
1569-
include :data:`pardir`.
1572+
include :data:`pardir` (eg. ".." on UNIX systems).
15701573

15711574
This function handles UNC paths correctly.
15721575

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,6 +4206,9 @@ C-API
42064206
Documentation
42074207
-------------
42084208

4209+
- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument. Done with
4210+
great native-speaker help from R. David Murray.
4211+
42094212
- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
42104213
Initial patch for #13491 by Johannes Vogel.
42114214

0 commit comments

Comments
 (0)