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

Projects
None yet
2 participants
@caffodian
Copy link

commented Dec 23, 2014

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

This comment has been minimized.

Copy link
Owner

commented Dec 23, 2014

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

This comment has been minimized.

Copy link
Author

commented Dec 24, 2014

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

This comment has been minimized.

Copy link
Owner

commented Dec 26, 2014

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

@jschneier jschneier force-pushed the jschneier:master branch from f248d9f to 039c82c Dec 27, 2014

@jschneier

This comment has been minimized.

Copy link
Owner

commented Dec 29, 2014

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

@jschneier jschneier closed this Dec 29, 2014

@caffodian

This comment has been minimized.

Copy link
Author

commented Dec 30, 2014

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
You can’t perform that action at this time.