#13750: ImageField accessing height or width and then data results in "I/O
operation on closed file"
--------------------------------------+------------------------------------
     Reporter:  ROsborne              |                    Owner:  aethemba
         Type:  Bug                   |                   Status:  assigned
    Component:  File uploads/storage  |                  Version:  1.2
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by aethemba):

 Replying to [comment:18 timgraham]:
 > Still not sure the patch is ideal as noted on the pull request. By the
 way, there's no need to attach the patch to the ticket if you send a pull
 request.

 Hey Tim,

 thanks for the feedback, much appreciated. I'm a bit confused though:

 "Can you make this work adding self.assertTrue(profile.image.closed) after
 this line? I wouldn't expect accessing the image dimensions to leave the
 file opened."

 Isn't that contradicting with the original complaint of the ticket? If I
 close the file after accessing the height or image the regression test
 will fail because a closed file will throw the IO error when passed to an
 Image.open().

 I'm not sure which direction to take to resolve this issue correctly.

--
Ticket URL: <https://code.djangoproject.com/ticket/13750#comment:19>
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/066.bc0094b9e0b015b4827ef75812246d8d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to