Closed GoogleCodeExporter closed 9 years ago
triggered in both places by a call to FriendshipManager.are_friends
def are_friends(self, user1, user2):
if self.filter(from_user=user1, to_user=user2).count() > 0:
return True
if self.filter(from_user=user2, to_user=user1).count() > 0:
return True
looks like a subtle upstream bug with the db api?
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 8:33
Attachments:
hmm I tried rewriting the above function as
def are_friends(self, user1, user2):
if self.filter((Q(from_user=user1) & Q(to_user=user2))
| (Q(from_user=user2) & Q(to_user=user1))
).count() > 0:
return True
return False
but still get the same error.
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 9:04
Take a look at this ticket: http://code.djangoproject.com/ticket/882
See if his solution works and post back ericdrex.
Original comment by gregoryj...@gmail.com
on 26 Sep 2008 at 9:07
I had tried putting a self.connection.cursor().close() right before the last
line of
the trace in db/backends/__init__.py
I should mention that commenting either of the two tests in are_friends makes
the
error go away. I tried putting
from django.db import connection
connection.cursor().close()
between the two tests, but this seems wrong and doesn't work anyway. What do
you suggest?
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 9:23
django-admin.py sqlclear with SQLite
Original comment by gregoryj...@gmail.com
on 26 Sep 2008 at 9:25
Ah, I see why the in-memory "testserver" database isn't affected:
http://code.djangoproject.com/browser/django/trunk/django/db/backends/sqlite3/ba
se.py#L154
Commenting the close line there certainly fixes it, but I'd imagine there may be
consequences for not closing your connection
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 9:34
well, i give up for now. maybe there is enough info here to file an upstream bug
report, provided it's reproducible by someone?
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 9:52
gregory: I'm not sure what you are suggesting. That ticket is very old. I think
maybe
cursor.close needs to be called somewhere, but not sure where (since I tried at
the
last possible moment)
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 7:52
ericdrex, i'm simply asking you to try it. I don't think anyone else has had
issues with sqlite including myself.
Original comment by gregoryj...@gmail.com
on 26 Sep 2008 at 7:56
try what?
Original comment by ericd...@gmail.com
on 26 Sep 2008 at 9:34
Somehow I fixed this, I think by
find -type f -name "*.py[co]" -delete
Since it's a ghost bug, can somebody mark it a closed/invalid?
Original comment by ericd...@gmail.com
on 27 Sep 2008 at 4:45
Original comment by gregoryj...@gmail.com
on 27 Sep 2008 at 10:13
this behavior cropped up again when I moved (relocated) my django and
django-hotclub
directories, and was fixed by running
find -type f -name "*.py[co]" -delete
on both directories, so this may be triggered by relocating one of those
directories,
just in case anyone else encounters this.
Original comment by ericd...@gmail.com
on 28 Sep 2008 at 3:30
Original issue reported on code.google.com by
ericd...@gmail.com
on 26 Sep 2008 at 7:31