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

Make sure that we read the file from the beginning in Azure Storage backend #562

Closed
wants to merge 1 commit into from

Conversation

m1kola
Copy link
Contributor

@m1kola m1kola commented Aug 20, 2018

The same as #561, but for Azure Storage backend

I'm not familiar with Azure Storage and I'm not using it. Also there are no tests for this backend, so please, review this carefully :)

@@ -88,6 +88,7 @@ def _save(self, name, content):
else:
content_type = mimetypes.guess_type(name)[0]

content.seek(0)
if hasattr(content, 'chunks'):
content_data = b''.join(chunk for chunk in content.chunks())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand content is a file-like object, but I have no idea about this case. Is it something Azure-specific? Is it ok to call seek on content before this?

@jschneier
Copy link
Owner

Azure storage was massively rewritten and merged in since then. However this does appear to be a real issue and I have opened #582 to resolve it. Thanks for the PRs.

@jschneier jschneier closed this Sep 2, 2018
@m1kola m1kola deleted the rewind_file_azure branch September 3, 2018 05:41
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

Successfully merging this pull request may close these issues.

2 participants