Open mgersh opened 8 years ago
This appears to be an issue caused by having a class title with non-ASCII in it. I'm surprised we haven't encountered it before; it's possible it's a regression in django. To repro (C9599 has a "ö" in its title):
print Q(classsubject__in=ClassSubject.objects.filter(id=9599))
In particular, this isn't actually an error in depickling. You can depickle the Q object just fine; it's printing/repr
ing it afterwards that causes the error.
I think this is a django bug. I'm going to look into it more sometime not-now, but until such time:
str()
/repr()
/unicode()
the Q
object, so if we aren't actually doing that, we're fine, andClassSubject.__str__
to (temporarily) do a .encode('ascii', errors='ignore')
or some such.Whoops, not-now turned out to be now -- Django bug reported: https://code.djangoproject.com/ticket/25875. The fix should be simple enough assuming nothing unexpected breaks; I'm not entirely sure if they'll want to backport it to 1.8, though.
BTW, this was not backported, so if we want to fix this before django 1.10, we'll have to either work around it or just ignore it.
I created a combination list, with the base list 'teachers teaching an approved class' and added 'AND NOT teachers who have taught for a previous program'. Then I opened a shell and tried to unpickle the corresponding PQF's q_filter, and got an error. It's the PQF with id 11616 on MIT's site.