[docs] typo in shutil.move documentation?

Charles Hamilton chamilton at dyercpa.com
Mon Mar 19 15:10:52 CET 2012


Hi! I believe I've found a typo in the documentation; specifically, 
shutil.move:

http://docs.python.org/library/shutil.html

_According to the docs:_

shutil.move(/src/,/dst/)
    Recursively move a file or directory (/src/) to another location
    (/dst/).
    If the destination is a directory or a symlink to a directory,
    then/src/is moved inside that directory.
    *The destination directory must not already exist.* If the
    destination already exists but is not a directory, it may be
    overwritten depending onos.rename()
    <http://docs.python.org/library/os.html#os.rename>semantics.
    If the destination is on the current filesystem, thenos.rename()
    <http://docs.python.org/library/os.html#os.rename>is used.
    Otherwise,/src/is copied (usingshutil.copy2()
    <http://docs.python.org/library/shutil.html#shutil.copy2>)
    to/dst/and then removed.
    New in version 2.3.


###

But that's not correct; if a directory doesn't exist before trying to 
move a file into it, shutil.move raises an IOError (as you'd expect). 
Please let me know if I'm not correct on this. Thanks!

-- 
------------------------------------------------------------------------
Charles Hamilton
I.T. Department
Dyer & Associates, P.C.
10415 Armory Ave
Kensington, MD 20895

chamilton at dyercpa.com
301.654.6200 (office)
301.814.6664 (cell)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120319/a567f577/attachment-0001.html>


More information about the docs mailing list