[docs] [issue16278] os.rename documentation slightly inaccurate

Todd Rovito report at bugs.python.org
Wed Nov 7 06:17:26 CET 2012


Todd Rovito added the comment:

Chris,
   That is an excellent suggestion.  I modified my OSRenameCombinations.py program and attached.  This program prints a table with the src parameters as columns and the dst as rows.  Hopefully it will show up ok in the bug tracker.


For Unix
                              src_file                       src_directory_empty            src_directory_not_empty        src_file_or_directory_not_exist 
dst_file_exist                 rename overwrite               raises OSError                 raises OSError                 raises OSError                 
dst_not_exist                  rename                         rename                         rename                         raises OSError                 
dst_directory_empty            raises OSError                 rename overwrite               rename overwrite               raises OSError                 
dst_directory_not_empty        raises OSError                 raises OSError                 raises OSError                 raises OSError                 
For Windows
                              src_file                       src_directory_empty            src_directory_not_empty        src_file_or_directory_not_exist 
dst_file_exist                 raises OSError                 raises OSError                 raises OSError                 raises OSError                 
dst_not_exist                  rename                         rename                         rename                         raises OSError                 
dst_directory_empty            raises OSError                 raises FileExistsError         raises FileExistsError         raises OSError                 
dst_directory_not_empty        raises OSError                 raises OSError                 raises OSError                 raises OSError

----------
Added file: http://bugs.python.org/file27915/OSRenameCombinations.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16278>
_______________________________________


More information about the docs mailing list