mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
shutil.move tries to move files by renaming them. If that fails with OSError (due to permission or cross-filesystem rename) it falls back to copying files followed by removing them (https://github.com/python/cpython/blob/2.7/Lib/shutil.py#L279). By using shutil.move and catching permission problems we avoid an unnecessary copy if source and destination are on the same filesystem. Also avoids shutil.move if the upload tool is run as real-user which should fix https://github.com/galaxyproject/galaxy/issues/4300.