[Zope-dev] Re: ZopeVersionControl bug

Dorneles Treméa deo at plonesolutions.com
Wed Dec 13 19:10:39 EST 2006


Hey Rob, folks,

> in any event, CMFEditions (a versioning system for Plone) depends on ZVC, and 
> it seems that some recent changes to Zope's DateTime implementation have 
> caused a ZVC bug to come to the surface.  dorneles has recently improved the 
> ISO8601 support in the DateTime module (http://tinyurl.com/y9weck).  one of 
> the results is that DateTime('1') now is interpreted similarly to DateTime(1), 
> whereas before it would raise an error.

thanks for the pointer!

There was no tests for that behavior before... I'll add a few ones to
make sure this won't break again.

BTW, ISO8601 allows us to specify dates using only the year (or year
and month; or even only the century) and thus '19', '1900', '1900-01'
and '1900-01-01' will all be parsed as DateTime('1900/01/01').

What do you guys think about those specific cases? Does it break
BBB compatibility and should not be supported by the ISO8601 parser
at all? If so, please tell me, as I'm in middle of the process to
fix the ISO8601 parser to make everyone happy... :-)

> in ZVC's Repository.getVersionOfResource() method (http://tinyurl.com/yab2xw), 
> a selector is passed in, which the method will try to use in a number of ways 
> before deciding that there's no matching version to return.  the final test 
> looks like this:
> 
> try: date = DateTime(selector)
> except:
>      raise VersionControlError(
>          'Invalid version selector: %s' % selector
>      )
> else:
>      ... RETRIEVE BY TIMESTAMP HERE

I don't know the ZVC internals but relying in such a thing doesn't
seems to be the Right Thing™, I may be wrong, though ;-)

-- 
 ___________________________________________________________________

       Dorneles Treméa · Developer · Plone Solutions · Brazil

   Consulting · Training · Development · http://plonesolutions.com
 ___________________________________________________________________

  Plone Foundation · http://plone.org/foundation · Protecting Plone



More information about the Zope-Dev mailing list