[Zope-CMF] DateTime attribute error in one CMF instance but not another

Anton Hughes Anton.Hughes at utas.edu.au
Wed Nov 26 19:07:03 EST 2003


Hi All,

I've got a funny error with a filesystem python script calling DateTime.
Here is the relevant part of the code (it's lifted from PloneChat, which I'm
hacking to run on a CMFDefault portal):

from DateTime import DateTime

dt_date = DateTime(chat_date)

new_context = context.portal_factory.doCreate(context, id) # path of least
resistance - added Plone bits as required :)

new_context.manage_editLTPortalChat(moderation = moderation,
                                 chatDay = dt_date.year(),
                                 chatMonth = dt_date.month(),
                                 chatYear = dt_date.day()
				 )

Now on my development box (OSX10.3, Python2.1.3, CMF1.3.2), I can add
instances without any problems. But when I move it to the production server
(RedHat 7.1, Python2.1.3, CMF1.3.3), I get the following error when the chat
instance is added:

 
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 92, 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 126, in _exec
__traceback_info__: ({'script': <FSPythonScript at
/courses/LTPortalChat_edit used for /courses/chat>, 'context': <LTPortalChat
at /courses/chat>, 'container': <CMFSite instance at a830be8>,
'traverse_subpath': []}, ('', None, None, None, 0), {}, ('', None, None,
None, 0))
Module Script (Python), line 14, in LTPortalChat_edit
Module DateTime.DateTime, line 1302, in year
Module DateTime.DateTime, line 1056, in __getattr__
AttributeError: _year

When it is used subsequently, there are no problems. So I guess it is
somehow related to the initial creation. If anyone could point me in the
right direction for fixing this, I would be very grateful.

Thanks,

Anton Hughes

Data Administrator
Childhood Determinants of Adult Health Project
Menzies Centre for Population Health Research
Private Bag 23, Hobart Tasmania 7001

Email: anton.hughes at utas.edu.au
Web:  http://www.menzies.utas.edu.au/cohort/CDAH.htm
Phone: +61 (0) 3 6226 7761

=+=+++=====+++++++++=================+++++++++++++++++++++++++++++++
If you wrap the Internet around every person on the planet and spin the
planet, 
software flows in the network.
           -- Moglen's Metaphorical Corollary to Faraday's Law



More information about the Zope-CMF mailing list