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

Delete file: B2RequestError: 400 - File not present #23

Open
fieldse opened this issue Oct 22, 2018 · 0 comments
Open

Delete file: B2RequestError: 400 - File not present #23

fieldse opened this issue Oct 22, 2018 · 0 comments

Comments

@fieldse
Copy link
Contributor

fieldse commented Oct 22, 2018

Hey there. Another one for today.

Edit: Looks like this is an issue on filenames with spaces. Adjusted original post accordingly.

Delete file fails (for filename containing spaces) with B2RequestError: 400 - File not present

Is this normal/expected behavior with object storage? (ie: Do we always need to clean filenames? Or should this be considered a bug?)

Code:

from b2blaze import B2
b2 = B2(key_id=id, application_key=key)
bucket = b2.buckets.get('some_bucket')
files = bucket.files.all()
>>> files[0].file_name
'a text file.1.txt'  # Note spaces in filename

>>> files[0].delete()
Resetting dropped connection: api002.backblazeb2.com
https://api002.backblazeb2.com:443 "POST /b2api/v1/b2_delete_file_version HTTP/1.1" 400 189
Traceback (most recent call last):
   [...]
    raise B2RequestError(decode_error(response))
b2blaze.b2_exceptions.B2RequestError: 400 - {'code': 'file_not_present', 'status': 400, 'message': 'File not present: a%20text%20file.1.txt [snip...file id] '}
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

1 participant