This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients paul.moore, stephan, steve.dower, tim.golden, vstinner, zach.ware
Date 2016-10-04.13:50:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
On Python 3 on Windows, os.rename() is implemented as MoveFileExW() with flags=0.

The doc says: "When moving a file, the destination can be on a different file system or volume. If the destination is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in dwFlags."

I guess that the portable fix is to try rename() or fall back on copy(src, dst) + delete(src).


On Python 2 on Windows, os.rename() is implemented as MoveFileW(). It seems like this function behaves as MoveFileEx() called with MOVEFILE_COPY_ALLOWED:

"A new file may be on a different file system or drive."


Should we add a flag to os.rename() to allow copy, to have a portable API?
Date User Action Args
2016-10-04 13:50:31vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, steve.dower, stephan
2016-10-04 13:50:31vstinnersetmessageid: <>
2016-10-04 13:50:31vstinnerlinkissue28356 messages
2016-10-04 13:50:30vstinnercreate