-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Cannot read a file (from s3) twice (ValueError: The file cannot be reopened). #1319
Comments
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. |
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 |
Thank you @jschneier |
django-storages 1.14 broke the ability to reopen a file, see jschneier/django-storages#1319.
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.The text was updated successfully, but these errors were encountered: