#26600: map says a queryset is not iterable
-------------------------------------+-------------------------------------
     Reporter:  ihucos               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  queryset iterator    |             Triage Stage:
  map                                |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by shaib):

 FWIW, the original traceback (which your `verbose_map()` hides) may be
 much more informative. Guessing that you're on Python 2,  you may want to
 rewrite it as something like:

 {{{#!python
 def verbose_map(function, iterable):
     try:
         return map(function, iterable)
     except TypeError:
         e_cls, e_inst, traceback = sys.exc_info()
         raise TypeError, (
                        'map failed: "{}". iterable: {}, type: {}, attrs:
 {}'.
                        format(e_inst, iterable, type(iterable),
 dir(iterable))
                   ), traceback
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26600#comment:2>
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/064.b319bc60cfb9fb0f8bb913bbb9f256fd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to