2008/3/5 Pigletto <pigle...@gmail.com>: > >> > Problem is possibly with multiple interpreters and psycopg2 again, >> >> Why do you say that? The thread you refer to above doesn't talk about >> mod_python, so do you have any extra evidence that support this claim? > There was a bug in psycopg2 with Decimal data type that sometimes > caused > error like that: > unsupported operand type(s) for *: 'Decimal' and 'Decimal' > > It was discussed on the list: > http://groups.google.com/group/django-users/browse_thread/thread/091aa6c088f6c090 > > Similarly to "can't adapt" it was raised sometimes, after apache was > running for few days, etc.. When error appears, restarting apache > causes everything to work fine but only for some time and then again, > errors are appearing. It was said that Decimal problem is caused by > running psycopg2 with multiple interpreters, so thats why I think > "can't adapt" might be the same thing. > Exactly same place, same data entered in the form and after submit > sometimes I get "can't adapt" and sometimes (after apache restart) > everything works. >
Sorry for opening an old thread but this is exactly the problem we have had today with an application that has been running for nearly two years. We're using mod_python and we run two different sites. We have the can't adapt error at random basis. Once is produced in one site the other site gives the same error. I don't know if is related or not, but the only thing we have done is to update to the security patch of 1.0 version. Actually we have updated to the 1.1.2 version but the error still happens. Restarting Apache makes everythink running again, but after some time the error appears. The request involves making a query that Django converts to a Decimal number (a request between 0 and 999999999), I have refactored to make a different query so It seems this kind of error is not solved. Traceback follows: Traceback (most recent call last): File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/core/handlers/base.py", line 92, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/var/pywww/trobacasaweb/trobacasa/views.py", line 502, in buscar resultado['page'] = paginator.page(actual_page) File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/core/paginator.py", line 37, in page number = self.validate_number(number) File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/core/paginator.py", line 28, in validate_number if number > self.num_pages: File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/core/paginator.py", line 60, in _get_num_pages if self.count == 0 and not self.allow_empty_first_page: File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/core/paginator.py", line 48, in _get_count self._count = self.object_list.count() File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/db/models/query.py", line 292, in count return self.query.get_count() File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/db/models/sql/query.py", line 376, in get_count number = obj.get_aggregation()[None] File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/db/models/sql/query.py", line 348, in get_aggregation result = query.execute_sql(SINGLE) File "/usr/local/virtualenvs/trobacasa/lib/python2.5/site-packages/django/db/models/sql/query.py", line 2369, in execute_sql cursor.execute(sql, params) ProgrammingError: can't adapt -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---