id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 7204 QuerySet cloning can sometimes fail Dorian Grey Jacob "[Original bug report removed; see [http://code.djangoproject.com/ticket/7204#comment:2 the second comment] for the original report. --JKM] Under some circumstances -- often involving {{{select_related()}}} and {{{count()}}} -- {{{QuerySet.clone()}}} can cause exceptions related to deepcopy(). These exceptions look like {{{ TypeError: instancemethod expected at least 2 arguments, got 0 }}} or {{{ 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." closed Core (Other) dev fixed qsrf-cleanup revision 7520 Unreviewed 0 0 1 0 0 0