diff -r 7219cd440d4c Doc/library/os.rst --- a/Doc/library/os.rst Sat Oct 20 16:27:51 2012 +0300 +++ b/Doc/library/os.rst Sat Oct 20 16:23:05 2012 -0400 @@ -1720,18 +1720,21 @@ .. function:: rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None) - Rename the file or directory *src* to *dst*. If *dst* is a directory, - :exc:`OSError` will be raised. On Unix, if *dst* exists and is a file, it will - be replaced silently if the user has permission. The operation may fail on some - Unix flavors if *src* and *dst* are on different filesystems. If successful, - the renaming will be an atomic operation (this is a POSIX requirement). On - Windows, if *dst* already exists, :exc:`OSError` will be raised even if it is a - file. + Rename the file or directory *src* to *dst*. If *dst* is a directory that + is not empty, :exc:`OSError` will be raised. On Unix, if *dst* exists and + is a file, it will be replaced silently if the user has permission and src + is a file. On Unix, if *src* is a directory and *dst* is a file + :exc:`NotADirectoryError` will be raised. The operation may fail on some + Unix flavors if *src* and *dst* are on different filesystems. If + successful, the renaming will be an atomic operation (this is a POSIX + requirement). On Windows, if *dst* already exists, :exc:`OSError` will be + raised even if it is a file. This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to supply :ref:`paths relative to directory descriptors `. - If you want cross-platform overwriting of the destination, use :func:`replace`. + If you want cross-platform overwriting of the destination, use + :func:`replace`. Availability: Unix, Windows.