Closed todorvelichkov closed 1 year ago
I’m seeing the same thing here with django-imagekit. Trying to downgrad to fix the issue. I’ll report back when I managed to do it. If noone else can, I’ll try to look at a workaround on Monday.
Okay so the behavior in 1.13.2 is obviously wrong; after the closing of a contextmanager we should be reading closed.
The bug here relates to the fact that the base Django File.open assumes the filesystem API.
So the proper fix is something along the lines of #1227.
I wonder if there is a good way to see this fixed upstream (e.g adding a StorageFile
class) but for now I suppose we should fix it since it seems that people were relying on the previous behavior.
Thank you @jschneier
I know there has been some issue with the
file.closed
attribute which has been worked on in1.14.0
and1.14.1
. But it looks like there is another issue, where a file cannot be re-read after close.I've made a simple function to illustrate the behavior differences between
1.13.2
,1.14.0
and1.14.1
(Django==4.2.5
).1.13.2
- Notice that I can run the function twice.1.14.0
- Fails on the second attempt.1.14.1
- Again, Fails on the second attempt.