@@ -348,21 +348,24 @@ Directory and files operations
348348
349349.. function :: move(src, dst, copy_function=copy2)
350350
351- Recursively move a file or directory (*src *) to another location (* dst *)
352- and return the destination.
351+ Recursively move a file or directory (*src *) to another location and return
352+ the destination.
353353
354- If the destination is an existing directory, then *src * is moved inside that
355- directory. If the destination already exists but is not a directory, it may
356- be overwritten depending on :func: `os.rename ` semantics.
354+ If *dst * is an existing directory or a symlink to a directory, then *src *
355+ is moved inside that directory. The destination path in that directory must
356+ not already exist.
357+
358+ If *dst * already exists but is not a directory, it may be overwritten
359+ depending on :func: `os.rename ` semantics.
357360
358361 If the destination is on the current filesystem, then :func: `os.rename ` is
359- used. Otherwise, *src * is copied to * dst * using *copy_function * and then
360- removed. In case of symlinks, a new symlink pointing to the target of * src *
361- will be created in or as * dst * and *src * will be removed.
362+ used. Otherwise, *src * is copied to the destination using *copy_function *
363+ and then removed. In case of symlinks, a new symlink pointing to the target
364+ of * src * will be created as the destination and *src * will be removed.
362365
363- If *copy_function * is given, it must be a callable that takes two arguments
364- *src * and * dst * , and will be used to copy *src * to * dst * if
365- :func: `os.rename ` cannot be used. If the source is a directory,
366+ If *copy_function * is given, it must be a callable that takes two arguments,
367+ *src * and the destination , and will be used to copy *src * to the destination
368+ if :func: `os.rename ` cannot be used. If the source is a directory,
366369 :func: `copytree ` is called, passing it the *copy_function *. The
367370 default *copy_function * is :func: `copy2 `. Using :func: `~shutil.copy ` as the
368371 *copy_function * allows the move to succeed when it is not possible to also
0 commit comments