-
Notifications
You must be signed in to change notification settings - Fork 170
Admin error when using some of file storage backends #302
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
Comments
I can confirm that this is also happening to me, using django-storages and S3/Boto, after upgrading from an older version. It seems like it changed beginning in 4.10.0, looking at this commit: 7e250b2 @martinmanzo any thoughts on why this had to move to using |
Hi @jordanambra, |
Hi @jordanambra, I was having OS errors due to files not being closed after being read and that solution did it for me. BTW I think you may be right, raw = attachment.document.read()
attachment.document.close()
encode_quopri(BytesIO(raw), output, quotetabs=True, header=False) And the same for the other changes in 7e250b2 Please note that I was using this in Django 3. Maybe the new versions Regards 💪 |
I don't think so. Indeed closing it explicitly should work but maybe we can also use it as a context manager:
Both solutions should work! @martinmanzo & @jordanambra can you give it a try to check both your issues are solved? 🙏 |
Sure, I'll need a couple of days to free some time and give it a go. |
NotImplementedError: This backend doesn't support absolute paths
is raised when opening e-mail messages with attachments in admin interface when using some remote file storage backends (via django-storages).I think the error is a result of trying to open attachments files directly using
open()
function; For example as in Message._rehydrate() method.May be a possibe soulution could be replacing direct calls to
open()
with open method from django storage backends; For example using something likeattachment.document.open('rb')
instead ofopen(attachment.document.path, 'rb')
Sample error log
The text was updated successfully, but these errors were encountered: