#14681: Uploaded files should not set mode to None ----------------------------------+----------------------------------------- Reporter: bgreenlee | Owner: nobody Status: new | Milestone: Component: File uploads/storage | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 1 | ----------------------------------+----------------------------------------- I ran across this issue when attempting to open an uploaded file with GzipFile(fileobj=uploaded_file). If you don't pass in the mode parameter as well, GzipFile crashes. GzipFile looks to see if the fileobj has a mode attribute, and if it does, it uses it; however, using a mode of None causes it to crash.
I filed a bug and patch for GzipFile (http://bugs.python.org/issue10392), but it was rejected, saying that the bug was in Django for setting the mode on the file to None. So I've attached a patch (with test) to django.core.files.base.File that only sets mode if mode is present. -- Ticket URL: <http://code.djangoproject.com/ticket/14681> Django <http://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 post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.