django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.73k stars 574 forks source link

Double .open() causing issues with django-storages 1.14 and S3 backend #1417

Closed GaretJax closed 10 months ago

GaretJax commented 10 months ago

django-storages 1.14 has been released with a bugfix for the closed File property: https://github.com/jschneier/django-storages/pull/1249

This causes the code at https://github.com/django-cms/django-filer/blob/master/filer/models/filemodels.py#L257-L260 to raise an exception and thus preventing _copy_file from being called.

At this point I'm unsure about what the fix would look like and whether that code is still required. If yes, it might be enough to check for src_file.closed before calling the second .open().

fsbraun commented 10 months ago

@GaretJax can you share the kind of issues you encountered? -- All right, I got it. (the exception link).

Can you check, however, if _move_file works for you (it does for me)?

fsbraun commented 10 months ago

Fixed in 3.0.6

GaretJax commented 9 months ago

Thanks @fsbraun; I somehow did not receive any notification from github for this activity.

fsbraun commented 9 months ago

Pleasure. Good catch!!