Fix wildcard sync command if files have special characters#761
Open
briceflaceliere wants to merge 3 commits intopeak:masterfrom
Open
Fix wildcard sync command if files have special characters#761briceflaceliere wants to merge 3 commits intopeak:masterfrom
briceflaceliere wants to merge 3 commits intopeak:masterfrom
Conversation
Member
|
Hey @briceflaceliere, thanks for sending a patch! Appreciated. Using Could you add your scenario to Lines 2142 to 2146 in 12d1038 |
|
Hello is there anything what could be done to get this fix in the next release please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem encountered:
I am using s5cmd to sync several million files, some of which contain special characters (such as
\u00a0, quotes, etc.). However, thesprintf("%q")function used ingenerateCommandmodifies these file names, causing the cp command to no longer find the files correctly.Solution provided:
To resolve this issue, I used the github.com/kballard/go-shellquote library to properly escape URL parameters without converting UTF-8 characters. This process is applied only when necessary, ensuring file names are preserved.
Test changes:
I modified the tests accordingly. However, I am not certain of the potential impact on other parts of the project. I will be able to confirm if this resolves the synchronization issues once the migration of our millions of files is completed.
Related issues:
synccommand executes erroneouscpcommands when local filenames contain certain characters. #521