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

s3boto modified_time fails for new file #11

Closed
wants to merge 1 commit into from

Conversation

caffodian
Copy link

This isn't actually my fix - I stumbled across it when trying to debug an issue with Mezzanine's usage of Django-Storages and involves a case where last_modified is not set for newly uploaded files.

https://bitbucket.org/david/django-storages/issue/163/s3boto-modified_time-fails-for-new-file

The PR towards original django-storages that I borrowed this fix from... seems like it's over a year old and never merged.

https://bitbucket.org/david/django-storages/pull-request/96/if-entrylast_modified-is-none-set-to/diff

@jschneier
Copy link
Owner

Hello and thanks for your contribution. Just from reading the bug report on the original repo this only occurs when AWS_PRELOAD_METADATA=True right? I need a little bit of time to familiarize myself with the ramifications of that setting before I merge this but I'll get to that ASAP.

@caffodian
Copy link
Author

Yea, I believe this only applies to that case. The entry will exist but it will try to parse the None timestamp and die if you call modified_time on a new file.

Sorry for the lack of an actual repro test case or anything at the moment - I stumbled across this repo when trying to get storages to work with a newer version of boto, and this was a fix I'd found while getting mezzanine's filebrowser working on s3. Will be glad to help out once holiday madness dies down ;)

@jschneier
Copy link
Owner

I think this was very close. Have a look at #14.

@jschneier
Copy link
Owner

Just merged mine in and closing this. Thanks for the inspiration and the bug report!

@jschneier jschneier closed this Dec 29, 2014
@caffodian
Copy link
Author

thanks for the fix! Looks like it should work and I'll give it a shot with my particular issue when I'm back in the office after the holidays. Hopefully I have a more meaningful contribution next time around ;)

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