#22718: django.core.files.File doesn't handle certain file-like objects (e.g.
zipfile.ZipExtFile)
--------------------------------------+------------------------------------
Reporter: linkjuggler@… | Owner: mshafiq9
Type: Bug | Status: assigned
Component: File uploads/storage | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by anonymous):
For me (the issue reporter) the only issue was size() failing. So I
solved it by wrapping the ZipFile in another class that copied the
file_size attribute of ZipFile to the _size attribute of the wrapping
class, and passed through the other file-like interface methods.
You could simply check for a "file_size" attribute in _get_size(), but I
agree it's probably not worth it if ZipFile is the only class that causes
the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/22718#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/079.c217e1202635da17782512bd117def80%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.