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

S3Boto3StorageFile close() should mimic FileSystemStorage.close() for empty files #435

Closed
Masterdanielsan opened this issue Nov 30, 2017 · 0 comments · Fixed by #816
Closed
Labels

Comments

@Masterdanielsan
Copy link

S3Boto3StorageFile close() vs. FileSystemStorage.close()
The following code will fail to write a file in the former case but not in the latter:

Setup: 'some/path/to/file.txt' doesn't exist in S3 or on File system in either case

file = default_storage.open('some/path/to/file.txt', 'w')
file.close()

One shouldn't have to call file.write() before file.close() in order to create an empty file.

This would make S3Boto3StorageFile consistent with a regular python open() command as well as the FileSystemStorage.open() command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants