If the destination of os.rename() exists then it will be overwritten if it is a file. This is the POSIX behaviour, which is also the CPython behaviour, and so we follow suit. See issue #2598 for discussion.
As per CPython semantics. In particular, file.__del__() should not raise an exception if the file is already closed.
Covered case: - Stat cases - Invalid read/write/flush/close - Invalid mkdir/rmdir/remove/getcwd - File seek/tell, modes a/x/+, t/b - Writing to a full disk - Full path rename, slash trim - Rename cases - Bytestring listdir - File object printing