diff options
Diffstat (limited to 'django/core/files/move.py')
-rw-r--r-- | django/core/files/move.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/django/core/files/move.py b/django/core/files/move.py index 9e6cfe7684..23491d6573 100644 --- a/django/core/files/move.py +++ b/django/core/files/move.py @@ -28,15 +28,14 @@ def _samefile(src, dst): def file_move_safe(old_file_name, new_file_name, chunk_size=1024 * 64, allow_overwrite=False): """ - Moves a file from one location to another in the safest way possible. + Move a file from one location to another in the safest way possible. - First, tries ``os.rename``, which is simple but will break across filesystems. - If that fails, streams manually from one file to another in pure Python. + First, try ``os.rename``, which is simple but will break across filesystems. + If that fails, stream manually from one file to another in pure Python. - If the destination file exists and ``allow_overwrite`` is ``False``, this - function will throw an ``IOError``. + If the destination file exists and ``allow_overwrite`` is ``False``, raise + ``IOError``. """ - # There's no reason to move if we don't have to. if _samefile(old_file_name, new_file_name): return |