#19895: Second iteration over an invalid queryset returns an empty list instead 
of
an exception
-------------------------------------+-------------------------------------
     Reporter:  gnosek               |                    Owner:  gnosek
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by akaariai):

 Here is a minimalistic case showing the bug in Python:
 {{{
 class MyObj(object):
     def __iter__(self):
         self._iter = iter(self.iterator())
         return iter(self._iter)

     def iterator(self):
         try:
             while True:
                 yield 1
         except Exception:
             raise
 i = next(iter(MyObj()))
 import gc
 gc.collect()
 print(gc.garbage)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19895#comment:8>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to