On Friday, 9 November 2012 00:31:39 UTC+1, Russell Keith-Magee wrote:

> If you can show a clear difference in behaviour between 1.3 and 1.4, then 
> you've definitely found a bug. If you can log this in Trac (and mark it as 
> a release blocker, since it's a change in behaviour), we can investigate 
> further.
>
> Yours,
> Russ Magee %-) 
>

I've traced the change back, but it doesn't seem to be introduced at 1.4. 
On 1.2, this works:

C:\Dev\django\bugs>manage.py shell
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from bugtest.models import *
>>> crash()
[]
>>> import django
>>> django.VERSION
(1, 2, 0, 'final', 0)
>>>

On 1.3.4:

C:\Dev\django\bugs>manage.py shell
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from bugtest.models import *
>>> crash()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Dev\django\bugs\bugtest\models.py", line 16, in crash
    print books
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\models\query.py",
 
line 69, in __repr__
    data = list(self[:REPR_OUTPUT_SIZE + 1])
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\models\query.py",
 
line 84, in __len__
    self._result_cache.extend(self._iter)
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\models\query.py",
 
line 273, in iterator
    for row in compiler.results_iter():
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\models\sql\compiler.py",
 
line 680, in results
_iter
    for rows in self.execute_sql(MULTI):
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\models\sql\compiler.py",
 
line 735, in execute
_sql
    cursor.execute(sql, params)
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\backends\util.py",
 
line 34, in execute
    return self.cursor.execute(sql, params)
  File 
"C:\Dev\Python27\lib\site-packages\django-1.3.4-py2.7.egg\django\db\backends\postgresql_psycopg2\base.py",
 
line 4
4, in execute
    return self.cursor.execute(query, args)
DatabaseError: syntax error at or near ")"
LINE 1: ...ugtest_book" WHERE "bugtest_book"."author_id" IN () LIMIT 21
                                                             ^
>>> import django; django.VERSION
(1, 3, 4, 'final', 0) 


It's also database dependent, I couldn't reproduce the issue with SQLite.


I've created a ticket, https://code.djangoproject.com/ticket/19263, but 
I've no idea how to classify it.

Thanks in advance for looking at this,


Chi Ho Kwok

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/gG9861FKpv0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to