#29510: QueryDict.copy() returns closed files when the type of file is
TemporaryUploadedFile
-------------------------------------+-------------------------------------
     Reporter:  Liquid Scorpio       |                    Owner:  Dan
                                     |  Madere
         Type:  Bug                  |                   Status:  assigned
    Component:  File                 |                  Version:  1.11
  uploads/storage                    |
     Severity:  Normal               |               Resolution:
     Keywords:  QueryDict, upload,   |             Triage Stage:  Accepted
  file                               |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Dan Madere):

 Replying to [comment:14 Carlton Gibson]:
 > > I stepped back, and pondered why are people copying a QueryDict
 anyway...
 >
 > This seems like the right thought to me. 🤔
 >
 > I have to admit I'm struggling to see the use-case — Folks would have to
 be making a copy of `request.FILES` for this to come up no? Why would you
 want a mutable copy of that? (Maybe more ☕️ is needed :)

 Thanks Carlton!

 Not necessarily, it could also be making a copy of `request.POST`, which
 surprisingly includes the files too. My theory is that most people believe
 that copying it only includes the query params, because that's the useful
 part to append more data to, and pass to the template.

 Regardless of the use case though, it seems impossible to me to copy a
 `TemporaryUploadedFile`. I don't see any reason people would expect it to
 actually copy the file.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29510#comment:15>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184735ef7f7-790bd4f6-bde5-4343-a70c-df9b4b387783-000000%40eu-central-1.amazonses.com.

Reply via email to