[Django] #35619: django.core.files.uploadfile.InMemoryUploadedFile has a serious bug

4 views
Skip to first unread message

Django

unread,
Jul 19, 2024, 6:27:21 AM7/19/24
to django-...@googlegroups.com
#35619: django.core.files.uploadfile.InMemoryUploadedFile has a serious bug
------------------------+------------------------------------------------
Reporter: qhsoft | Type: Bug
Status: new | Component: File uploads/storage
Version: 5.0 | Severity: Release blocker
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------------------
in class django.core.files.uploadfile.InMemoryUploadedFile

def chunks(self, chunk_size=None):
self.file.seek(0)
yield self.read() # this code, **should be yield
self.read(chunk_size)**

This bug will cause us to fail when writing to the file system after
reading the uploaded content, with the error "OSError: [Errno 5]
Input/output error"
--
Ticket URL: <https://code.djangoproject.com/ticket/35619>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 19, 2024, 6:39:53 AM7/19/24
to django-...@googlegroups.com
#35619: django.core.files.uploadfile.InMemoryUploadedFile has a serious bug
-------------------------------------+-------------------------------------
Reporter: XU GUI PING | Owner: (none)
Type: Bug | Status: new
Component: File | Version: 5.0
uploads/storage |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by XU GUI PING):

It doesn't seem to work. After the modification, the next problem will
occur. The file will only read the beginning part.
--
Ticket URL: <https://code.djangoproject.com/ticket/35619#comment:1>
Reply all
Reply to author
Forward
0 new messages