-
Notifications
You must be signed in to change notification settings - Fork 274
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
'seek of closed file' Error when using django-imagekit with Django 2.1.1 #473
Comments
From the traceback:
Rest framework is trying to serialize the file by iterate trough it's content (bytes) which I'm not sure is what you want. Because you are using the djangorestframework can you show us also your serialyzer? |
This is the serializer:
It's a very vanilla DRF serializer. I ended up swapping imagekit out for django-versatileimagefield and everything works great with the same serializer in place, however I still have record of all the code that caused this in my git history so if any more information is required, I'll be happy to provide it. |
Thank you for the information. As I see you probably has few extra methods/properties in the model This means that trying to create two thumbnails in the same request from the same source can fail. Thank you again for reporting the issue. |
Yes they return the url or a default noavatar image. They are marked with the |
same with s3 as media storage. And all works well if i remove content.seek(0) |
Any news on this? Getting same error on s3 |
Currently I have no time to look on this. If someone can debug it and came up with a patch I will be very greatfull. |
…aWatch issue 176).)
…f.file", then seek to start of file handle, and then "self.storage.save" (which will result in a closed file handle, from which we can no longer seek nor read)
Ok, after a thorough read of #391 I can say it's not related, though it is similar.
I am using Django default local storage. No storage plugins of any kind.
The following model code:
Causes the below error when attempting to retrive the model:
Versions (requirements.txt):
Traceback:
The text was updated successfully, but these errors were encountered: