Repository navigation
fix(lottie): Prevent SameFileError when exporting assets already in the images directory - #3506
Conversation
2779bd0 to
1afd602
Compare
|
Thank you for attempting to improve your contribution description! 🐞 Bug Fixes
|
|
Thank you for helping us to solve this issue! Instead of "Related issue:" at the beginning of the PR description, write it at the last line with the words "Close #", "Closes #", "Fix #" or "Fixes #". We are using Conventional Commits for a while. The PR and commit 'titles' should not start in upper case. |
|
Thank you for attempting to improve your contribution description! 🐞 Bug Fixes
|
6915fb9 to
a6e6a32
Compare
|
Hey @rodolforg thanks for suggesting corrections. Will follow the conventional commits hereafter. Apologies for multiple forced pushes. |
No issue here, it's ok. |
|
Thank you for attempting to improve your contribution description! 🐞 Bug Fixes
|
|
Merged. Thank you! |
This PR fixes the issue where exporting animations to Lottie format fails when imported assets are already located in the images subdirectory. The error occurs because shutil.copy throws a SameFileError when attempting to copy a file to itself.
Changes:
Added a try-except block to handle shutil.SameFileError when copying assets to the images directory.
Ensured that file metadata is only copied if the file copy operation succeeds.
Skipped redundant copying when the source and destination files are the same.
Fixes #3471