Replace instances of os.rename with shutil.move to handle the possibility of the destination being a different filesystem. If the source and destination are on the same filesystem, os.rename is used per https://docs.python.org/3.11/library/shutil.html#shutil.move
Replace instances of
os.rename
withshutil.move
to handle the possibility of the destination being a different filesystem. If the source and destination are on the same filesystem,os.rename
is used per https://docs.python.org/3.11/library/shutil.html#shutil.move