I am trying to use the postgres auth method from exUserFolder with a plone site but i get an error message in the plone interface. 'global name time not defined' Does anyone know what this error is caused by please? regards garry
garry saddington wrote at 2003-8-26 16:45 +0100:
I am trying to use the postgres auth method from exUserFolder with a plone site but i get an error message in the plone interface.
'global name time not defined'
Does anyone know what this error is caused by please?
I do not. But I know, that the traceback (--> /error_log) would help you to find out... Dieter
On Wednesday 27 August 2003 20:16, Dieter Maurer wrote:
garry saddington wrote at 2003-8-26 16:45 +0100:
I am trying to use the postgres auth method from exUserFolder with a plone site but i get an error message in the plone interface.
'global name time not defined'
Does anyone know what this error is caused by please?
I do not.
But I know, that the traceback (--> /error_log) would help you to find out...
Dieter Thanks, i have got the traceback but unfortunately i am not able to interpret it, can anyone help me please? It is actually while using NisUserFolder as i would prefer this method if i can get it to work. here it is
Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Products.CMFCore.FSPythonScript, line 90, in __call__ Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module Products.CMFCore.FSPythonScript, line 124, in _exec - __traceback_info__: ({'script': <FSPythonScript at /test/logged_in>, 'context': <PloneSite instance at 8f99a20>, 'container': <PloneSite instance at 8f99a20>, 'traverse_subpath': []}, (), {}, None) Module Script (Python), line 25, in logged_in Module Shared.DC.Scripts.Bindings, line 252, in __call__ Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec Module Products.CMFCore.FSPageTemplate, line 167, in _exec Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec Module Products.CMFCore.FSPageTemplate, line 139, in pt_render Module Products.PageTemplates.PageTemplate, line 95, in pt_render - <FSPageTemplate at /test/login_success> Module TAL.TALInterpreter, line 200, in __call__ Module TAL.TALInterpreter, line 244, in interpret Module TAL.TALInterpreter, line 703, in do_useMacro Module TAL.TALInterpreter, line 244, in interpret Module TAL.TALInterpreter, line 726, in do_defineSlot Module TAL.TALInterpreter, line 244, in interpret Module TAL.TALInterpreter, line 668, in do_condition Module Products.PageTemplates.TALES, line 217, in evaluate - Line 35, Column 12 - Expression: <PythonExpr not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email)> - Names: {'container': <PloneSite instance at 8f99a20>, 'default': <Products.PageTemplates.TALES.Default instance at 0x86c10ac>, 'here': <PloneSite instance at 8f99a20>, 'loop': <SafeMapping instance at 89ba160>, 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x86cc034>, 'nothing': None, 'options': {'args': ()}, 'repeat': <SafeMapping instance at 89ba160>, 'request': <HTTPRequest, URL=http://zope/test/logged_in>, 'root': <Application instance at 8f99100>, 'template': <FSPageTemplate at /test/login_success>, 'traverse_subpath': [], 'user': try} Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__ - __traceback_info__: not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email) Module Python expression "not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email)", line 2, in f AttributeError: ZopeTime Thanks in advance garry
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
garry saddington wrote:
Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__ - __traceback_info__: not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email) Module Python expression "not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email)", line 2, in f AttributeError: ZopeTime
Dunno what this logic is doing in a ZPT :-( Try replacing here.ZopeTime with modules['DateTime'].DateTime cheers, Chris
garry saddington wrote at 2003-8-28 07:40 +0100:
...
Thanks, i have got the traceback but unfortunately i am not able to interpret it, can anyone help me please?
Wow! This traceback is so strange that not even I understand what happens :-) I explain a bit the relevant parts of the traceback, such that you can interpret them better in the future:
Module Products.CMFCore.FSPythonScript, line 124, in _exec - __traceback_info__: ({'script': <FSPythonScript at /test/logged_in>, 'context': <PloneSite instance at 8f99a20>, 'container': <PloneSite instance at 8f99a20>, 'traverse_subpath': []}, (), {}, None)
The first interesting piece (everything before was basic framework): Here "FSPythonScript" "test/logged_in" was called with "context" and "container" both your Plone site.
Module Script (Python), line 25, in logged_in
The problem happens in line 25 of this python script.
.... Module Products.CMFCore.FSPageTemplate, line 167, in _exec
It calls an "FSPageTemplate"...
... Module Products.PageTemplates.PageTemplate, line 95, in pt_render - <FSPageTemplate at /test/login_success>
This is the "FSPageTemplate" "/test/login_success".
... Module Products.PageTemplates.TALES, line 217, in evaluate - Line 35, Column 12
The problem happens in line 35...
- Expression: <PythonExpr not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email)>
while evaluating "python: not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email"...
- Names: {'container': <PloneSite instance at 8f99a20>, 'default': <Products.PageTemplates.TALES.Default instance at 0x86c10ac>, 'here': <PloneSite instance at 8f99a20>, ... 'request': <HTTPRequest, URL=http://zope/test/logged_in>,
The request has been for "http://zope/test/logged_in".
... 'template': <FSPageTemplate at /test/login_success>,
This tells you again that we are in "FSPageTemplate at /test/login_success".
... 'user': try}
This tells you that the user "try" was successfully authenticated.
- __traceback_info__: not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email) Module Python expression "not(member.login_time == here.ZopeTime('2000/01/01') and here.validate_email)", line 2, in f AttributeError: ZopeTime
This tells you that an attribute lookup for "ZopeTime" failed in the above Python expression. There is just one such occurrence "here.ZopeTime". I know that "ZopeTime" is a method of Zope's root object, obtained via acquisition. When "here" is not able to acquire it, then it means, the root is not in "here"s acquisition context. This is *very* strange. Check "/test/login_success" whether someone has redefined "here". The redefinition might also be in some macro used by this template. But, as it is not very likely that someone redefines "here", you may also see some deep bug. By the way: you seem to get different exceptions: 'global name "time" is not defined' in your last message and now 'AttributeError "ZopeTime"' When you see random non-deterministic errors, this may indicate that some C level extension corrupts memory (usually reuses objects which still are in use). In this case, objects can suddenly change identity and value and class. Almost everything is possible. I saw such behaviour with Python 2.1.x with "x < 3". Then, Python itself was the bad "C" level "extension". Dieter
participants (3)
-
Chris Withers -
Dieter Maurer -
garry saddington