[Zope3-dev] time.strptime doesn't exist in 2.2 everywhere

Guido van Rossum guido@python.org
Wed, 08 Jan 2003 17:14:28 -0500


> On Wednesday 08 January 2003 15:15, Tim Peters wrote:
> > The problem is that strptime isn't an ANSI C function, so its availability
> > is platform-dependent.  Python 2.3 adds a Python implementation of strptime
> > so that the function is available everywhere, but before 2.3 (incluing
> > 2.2.2) strptime is only available under most (not all) flavors of Unix.
> >
> > I believe the only use of strptime in Zope3 is in the locales.py line
> > listed above in the traceback, so there are probably many ways around this.
> > Somebody who understands this subsystem should pick one <wink>.
> 
> I wrote it, so I would like to fix it. How can I do this? Should I make a 
> monkey patch for Python2.2 or what is the best solution? I mean I know 
> exactely how the datetime string looks like, so manual parsing would not be 
> too bad, but a bit cumbersome.
> 
> Regards,
> Stephan

Maybe you can copy _strptime.py from Python 2.3 into Zope?  Then
there's just a licensing issue.

--Guido van Rossum (home page: http://www.python.org/~guido/)