[Zope3-dev] zope3 doesn't like the python datetime module?

Anthony Baxter anthony at interlink.com.au
Fri Sep 19 02:56:28 EDT 2003


When trying to use zope.interface outside Zope, without the src/datetime
package, tests fail with:

  File "test.py", line 487, in get_suite
    mod = package_import(modname)
  File "test.py", line 479, in package_import
    mod = __import__(modname)
  File "zope/interface/common/tests/test_idatetime.py", line 22, in ?
    from zope.interface.common.idatetime import ITimeDelta, ITimeDeltaClass
  File "zope/interface/common/idatetime.py", line 574, in ?
    directlyProvides(timedelta, ITimeDeltaClass)
  File "zope/interface/declarations.py", line 969, in directlyProvides
    object.__provides__ = ProvidesSpecification(*interfaces)
TypeError: can't set attributes of built-in/extension type 'datetime.timedelta'

This makes me sad. Can anyone suggest a fix? It looks like the 
implemented-in-C datetime code breaks when fed into the interface
code. Assuming that a) Zope3 doesn't want to maintain it's own
datetime package for ever, and/or b) Zope3 wants to use the C code
version at some point for speed, this is a problem.

Anthony



More information about the Zope3-dev mailing list