#14766: ordering by a field that does not exists returns an empty QuerySet
---------------------------------------------------+------------------------
          Reporter:  robhudson                     |         Owner:  nobody     
           
            Status:  closed                        |     Milestone:             
           
         Component:  Database layer (models, ORM)  |       Version:  1.2        
           
        Resolution:  wontfix                       |      Keywords:  
sprintdec2010 order_by
             Stage:  Accepted                      |     Has_patch:  1          
           
        Needs_docs:  0                             |   Needs_tests:  0          
           
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Changes (by russellm):

  * status:  reopened => closed
  * resolution:  => wontfix

Comment:

 The problem here is being caused by Python itself. For a couple of
 releases of Python 2.6, http://bugs.python.org/issue1242657 meant that
 exceptions raised during iteration were transparently swallowed by the
 iteration process. The field error *is* being raised; but the fact that
 you're iterating over the results means that the exception is eaten,
 resulting in an empty result set.

 If you're on a Mac with a default Snow Leopard Python install, you have
 Python 2.6.1, which is affected. If you have an up to date Python install
 (2.6.5 at time of writing), the problem has been fixed. I *think* it was
 fixed in Python 2.6.2, but I haven't got an install handy to check.

 Since this appears to be due to a bug in Python that has been addressed,
 and it's a non-trivial thing to work around, I'm going to mark this
 wontfix. If you are affected by this, the solution is to upgrade to Python
 2.6.5+.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14766#comment:10>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to