#20963: order_by interaction with "brew" distribution of Python 2.7.5 introduces edge-case regression -------------------------------------+------------------------------------- Reporter: ptone | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: (models, ORM) | 1.6-beta-1 Severity: Normal | Resolution: Keywords: | Triage Stage: Has patch: 0 | Unreviewed Needs tests: 0 | Needs documentation: 0 Easy pickings: 0 | Patch needs improvement: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Description changed by ptone:
Old description: > This commit: > > https://github.com/django/django/commit/69597e5bcc89aadafd1b76abf7efab30ee0b8b1a > > introduced a change that interacts with the OS X specific "brew" > installation of Python 2.7.5 to result in a regression in one test. > > {{{ > FAIL: test_tickets_2076_7256 > (regressiontests.queries.tests.Queries1Tests) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File > "/Users/admin/Desktop/django/tests/regressiontests/queries/tests.py", > line 437, in test_tickets_2076_7256 > ['<Item: one>', '<Item: two>', '<Item: one>', '<Item: two>', '<Item: > four>'] > File "/Users/admin/Desktop/django/django/test/testcases.py", line 776, > in assertQuerysetEqual > return self.assertEqual(list(items), values) > AssertionError: Lists differ: [] != [u'<Item: one>', u'<Item: two>... > > Second list contains 5 additional elements. > First extra element 0: > <Item: one> > > - [] > + [u'<Item: one>', > + u'<Item: two>', > + u'<Item: one>', > + u'<Item: two>', > + u'<Item: four>'] > > ---------------------------------------------------------------------- > Ran 1 test in 0.033s > > FAILED (failures=1) > }}} > > This is limited only to this patched distribution of Python. > Unfortunately this is a rather common version to be running on developer > machines. > > This gist shows this error on a clean machine with the brew version of > 2.7.5, and the python.org binary install version of 2.7.5 > > The crux of the issue can be seen in this PDB session started from the > failing test: > > {{{ > (Pdb) Item.objects.filter(tags__isnull=False) > [<Item: four>, <Item: one>, <Item: one>, <Item: two>, <Item: two>] > (Pdb) Item.objects.filter(tags__isnull=False).order_by('tags') > [] > }}} New description: This commit: https://github.com/django/django/commit/69597e5bcc89aadafd1b76abf7efab30ee0b8b1a introduced a change that interacts with the OS X specific "brew" installation of Python 2.7.5 to result in a regression in one test. {{{ FAIL: test_tickets_2076_7256 (regressiontests.queries.tests.Queries1Tests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/admin/Desktop/django/tests/regressiontests/queries/tests.py", line 437, in test_tickets_2076_7256 ['<Item: one>', '<Item: two>', '<Item: one>', '<Item: two>', '<Item: four>'] File "/Users/admin/Desktop/django/django/test/testcases.py", line 776, in assertQuerysetEqual return self.assertEqual(list(items), values) AssertionError: Lists differ: [] != [u'<Item: one>', u'<Item: two>... Second list contains 5 additional elements. First extra element 0: <Item: one> - [] + [u'<Item: one>', + u'<Item: two>', + u'<Item: one>', + u'<Item: two>', + u'<Item: four>'] ---------------------------------------------------------------------- Ran 1 test in 0.033s FAILED (failures=1) }}} This is limited only to this patched distribution of Python. Unfortunately this is a rather common version to be running on developer machines. This gist shows this error on a clean machine with the brew version of 2.7.5, and the python.org binary install version of 2.7.5 https://gist.github.com/ptone/0764601b524fb87a690d The crux of the issue can be seen in this PDB session started from the failing test: {{{ (Pdb) Item.objects.filter(tags__isnull=False) [<Item: four>, <Item: one>, <Item: one>, <Item: two>, <Item: two>] (Pdb) Item.objects.filter(tags__isnull=False).order_by('tags') [] }}} -- -- Ticket URL: <https://code.djangoproject.com/ticket/20963#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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.c2b8298f75338a6ad8e4adc4abbfde91%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.