Skip to content

Conversation

@majiayu000
Copy link

Summary

  • Replace os.rename() with shutil.move() in file upload processing
  • On Windows, os.rename() fails with FileExistsError when target exists
  • shutil.move() handles this case by removing the existing target file

Test plan

  • Added unit tests for file rename scenarios
  • Test covers: target exists, target not exists, special characters

Fixes #765

Fixes Cinnamon#765

On Windows, os.rename() raises FileExistsError when the target file
already exists. This change replaces os.rename() with shutil.move()
which handles this case by removing the existing target file before
moving.

Signed-off-by: majiayu000 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FileExistsError

1 participant