QuerySet cloning can sometimes fail
|Reported by:||Owned by:||Jacob|
|Severity:||Keywords:||qsrf-cleanup revision 7520|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
Description (last modified by )
[Original bug report removed; see the second comment for the original report. --JKM]
Under some circumstances -- often involving
QuerySet.clone() can cause exceptions related to deepcopy(). These exceptions look like
TypeError: instancemethod expected at least 2 arguments, got 0
TypeError: function expected at least 2 arguments, got 0
The first one involving
instancemethod is probably related to a Python issue: see http://bugs.python.org/issue1515.
The second involving
function only seems to occur on Python 2.4 (and not 2.5), but since 1515 isn't fixed yet, it may be a seperate problem.
In either case, though, the root problem is that for some reason QuerySet is trying to clone instancemethods and unbound functions, which isn't exactly supported -- dunno what a copy of a function would do anyway. The likely fix will involve finding out where and why functions/methods are being coppied, and stop doing that.
Change History (12)
comment:4 Changed 9 years ago by
|Summary:||.count() not working → QuerySet cloning can sometimes fail|
|Triage Stage:||Unreviewed → Accepted|
comment:11 Changed 7 years ago by
|Status:||closed → reopened|
|Triage Stage:||Accepted → Unreviewed|