diff --git a/Doc/library/os.rst b/Doc/library/os.rst --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1183,13 +1183,14 @@ single: UNC paths; and os.makedirs() Recursive directory creation function. Like :func:`mkdir`, but makes all - intermediate-level directories needed to contain the leaf directory. If - the target directory with the same mode as specified already exists, - raises an :exc:`OSError` exception if *exist_ok* is False, otherwise no - exception is raised. If the directory cannot be created in other cases, - raises an :exc:`OSError` exception. The default *mode* is ``0o777`` (octal). - On some systems, *mode* is ignored. Where it is used, the current umask - value is first masked out. + intermediate-level directories needed to contain the leaf directory. If the + target directory with the same mode as specified already exists, raises an + :exc:`OSError` exception unless *exist_ok* is True. If the target directory + exists with a mode that differs from the one supplied, an :exc:`OSError` is + raised no matter what *exist_ok* is set to. Also, if the directory cannot + be created in other cases, an :exc:`OSError` exception is raised. The + default *mode* is ``0o777`` (octal). On some systems, *mode* is ignored. + Where it is used, the current umask value is first masked out. .. note::