#27150: Wrong File object behavior if file object has no name attribute
------------------------------+--------------------------------------
     Reporter:  pacahon       |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  Core (Other)  |                  Version:  1.10
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------
Changes (by bmispelon):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Hi,

 As far as I can tell, `File.__bool__` is not documented but it does seem
 to be used internally and is somewhat tested (though maybe not directly):
 changing it to `return False` yields quite a few errors and failures in
 the test suite.


 Because of this lack of documentation, it's hard to tell if the behavior
 you're describing is a bug.

 I think it'd be worth it to:

 1) Document `File.__bool__` (both in the reference docs and in the
 docstring)
 2) Figure out if we can improve it by handling underlying files with no
 names as you suggest.


 What do you think?

--
Ticket URL: <https://code.djangoproject.com/ticket/27150#comment:1>
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/065.cd77a75ea05a9858114495dae3445a9d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to