[Zope-DB] Psycopg and HappySession module

FLOPEZ fernando@dilmun.ls.fi.upm.es
Thu, 27 Jun 2002 12:43:05 +0200


	Hi 

	I'm tring to change my PygreSQL database connetion which i have been using in
Zope until today, for a Psycopg database connection.
	I installed Psycopg module without problems but when i use connection into Zope
i obtain this error message when i try to insert a date in my postgres database.

---------------------------------------------------------------------

Error Type: SystemError
 Error Value: Failed to import class localtime from module __main__

 Traceback (innermost last):
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
223, in publish_module
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/Zope/__init__.py, line 226, in
zpublisher_exception_hook
    (Object: ADD)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/mapply.py, line 160,
in mapply
    (Object: inicio)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: inicio)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/OFS/DTMLDocument.py, line 199,
in __call__
    (Object: inicio)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_String.py,
line 546, in __call__
    (Object: inicio)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/OFS/DTMLMethod.py, line 188, in
__call__
    (Object: add_html_header)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_String.py,
line 546, in __call__
    (Object: add_html_header)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/OFS/DTMLDocument.py, line 192,
in __call__
    (Object: inc_ses)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_String.py,
line 546, in __call__
    (Object: inc_ses)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_Util.py,
line 231, in eval
    (Object: SESSION.keys())
    (Info: SESSION)
  File <string>, line 2, in f
    (Object: guarded_getattr)
  File
/usr/local/Zope/Zope-2.4.2-src/lib/python/Products/HappySession/HappySession.py,
line 394, in keys
    (Object: SESSION)
  File
/usr/local/Zope/Zope-2.4.2-src/lib/python/Products/HappySession/HappySession.py,
line 301, in _initialize
    (Object: SESSION)
  File
/usr/local/Zope/Zope-2.4.2-src/lib/python/Products/HappySession/HappySession.py,
line 258, in _retrieve
    (Object: SESSION)
SystemError: (see above)

--------------------------------------------------------------------------

The object SESSION is of the module HappySession (one of de first versions)

This error occurs when in de Z Psycopg object i select the option 'Use Zope's
internal DateTime module
 (instead of mxDateTime).'

If i don't select this option then the error message that i obtain is this

-----------------------------------------------------------------------


Error Type: TypeError
 Error Value: can't coerce DateTime to the other type
 




Traceback (innermost last):
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
223, in publish_module
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/Zope/__init__.py, line 226, in
zpublisher_exception_hook
    (Object: ADD)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/mapply.py, line 160,
in mapply
    (Object: login)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: login)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/OFS/DTMLMethod.py, line 195, in
__call__
    (Object: login)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_String.py,
line 546, in __call__
    (Object: login)
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_In.py, line
770, in renderwob
    (Object: obtener_usuario(usuario=usuario))
  File /usr/local/Zope/Zope-2.4.2-src/lib/python/DocumentTemplate/DT_Util.py,
line 231, in eval
    (Object: SESSION.set('ULTIMO_ACCESO',ultimo_acceso))
    (Info: ultimo_acceso)
  File <string>, line 2, in f
    (Object: guarded_getattr)
  File
/usr/local/Zope/Zope-2.4.2-src/lib/python/Products/HappySession/HappySession.py,
line 379, in __setitem__
    (Object: SESSION)
TypeError: (see above)

--------------------------------------------------------------------------


	These errors ocurres with 1.07, 1.08 and 1.09 versions of Psycopg

	In both errors seem that the problem is my HappySession Module.

	There is any inconpatibility between Psycopg and HappySession?
	Is there any way to solve problem??
	Why problem occur???
	Why this not occur with PygreSql module???

	Thanks

Pd: I'm using Zope 2.4.2-src version and postgres 7.2.1





-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/