def rename(self, oldpath, newpath):
oldpath = self._adjust_cwd(oldpath)<EOL>newpath = self._adjust_cwd(newpath)<EOL>self._log(DEBUG, "<STR_LIT>".format(oldpath, newpath))<EOL>self._request(CMD_RENAME, oldpath, newpath)<EOL>
Rename a file or folder from ``oldpath`` to ``newpath``.

.. note::
    This method implements 'standard' SFTP ``RENAME`` behavior; those
    seeking the OpenSSH "POSIX rename" extension behavior should use
    `posix_rename`.

:param str oldpath:
    existing name of the file or folder
:param str newpath:
    new name for the file or folder, must not exist already

:raises:
    ``IOError`` -- if ``newpath`` is a folder, or something else goes
    wrong