Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: can not move, delete, download files with '[?]' in their filenames #1409

Open
tomsbergmanis opened this issue Dec 19, 2024 · 3 comments

Comments

@tomsbergmanis
Copy link

Hi
I had a file with an unfortunate filename containing '[?]' which s3cmd was unable to delete:
s3cmd rm s3://data/[?]_MP_-_Materials-f121-49af-8df1-27dad27f1ab9.zip

How to replicate:

 $ touch test_[?].txt
 $ s3cmd put test_\[\?\].txt s3://data/
upload: 'test_[?].txt' -> 's3://data/test_[?].txt'  [1 of 1]
 0 of 0     0% in    0s     0.00 B/s  done
upload: 'test_[?].txt' -> 's3://data/test_[?].txt'  [1 of 1]
 0 of 0     0% in    0s     0.00 B/s  done
 $ s3cmd ls  s3://data/test_\[\?\].txt
2024-12-19 08:31            0  s3://data/test_[?].txt
 $ s3cmd rm  s3://data/test_\[\?\].txt
 $ s3cmd ls  s3://data/test_\[\?\].txt
2024-12-19 08:31            0  s3://data/test_[?].txt

Expected behaviour: file gets deleted.

@fviard
Copy link
Contributor

fviard commented Dec 19, 2024

Can you retry with quotes around the path?

s3cmd rm "s3://data/[?]MP-_Materials-f121-49af-8df1-27dad27f1ab9.zip"

@tomsbergmanis
Copy link
Author

Still the same. Just checked with newer and older versions:
s3cmd version 2.4.0 and s3cmd version 2.2.0

I didn't look into the debug flag's output too much, but I got the gist that it does not find anything to delete. I expect that [?] is either escaped wrongly.

@snosratiershad
Copy link
Contributor

@tomsbergmanis I've tried both putting the object name in single quote and without it and couldn't reproduce the bug and the file correctly removed. In example above there is no output of rm command. could you please retry with verbose mode (with -v switch)?

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

No branches or pull requests

3 participants