[Python-Dev] Broken strptime in Python 2.3a1 & CVS

Brett Cannon bac@OCF.Berkeley.EDU
Tue, 14 Jan 2003 13:59:21 -0800 (PST)


[Guido van Rossum]

> > [Guido van Rossum]
> >
> > Now I *really* wish we were ripping ``rexec`` out instead of
> > crippling it.  =)
>
> Um, the issues aren't really rexec.py itself, but the general security
> framework; I think there's still something to say for that in the long
> run (even though right now it's not secure).
>

OK, my mistake.

> > > Why False and not None?
> >
> > Just playing with booleans at the time.  =)  I also thought that it made
> > sense: False as in it is false that you are going to get any info out of
> > this.  Although, None also makes sense.  I can change it easily enough.
>
> Please fix.
>

Sure thing.

> > > > for line in log_file:
> > > > 	time_tuple = _strptime.strptime(strptime_regex, line)
> > > >
> > > > That at least eliminates the overhead of having to rediscover the locale
> > > > information everytime.  I will add a doc patch with the patch that I am
> > > > going to do that adds the default values explaining this feature if no one
> > > > has objections (can only think this is an issue if it is decided it would
> > > > be better to write the whole thing in C and implementing this feature
> > > > would become useless or too much of a pain).
> > >
> > > Yeah, but this means people have to change their code.  OK, I think
> > > for speed hacks that's acceptable.
> >
> > So then I can document it, right?  Or should we just leave this as a
> > surprise for the more adventurous who read the source?
>
> No, it would be better if you ripped out any other undocumented
> "surprises" that might still be lurkig in _strptime.py.  Or at least
> owe up to them now so we can decide what to do with them.
>

Nope, that is the only thing with ``strptime``.  There is other stuff in
the module that might be helpful (like a class that discovers all locale
info for dates), but they in no way affect how ``strptime`` works.

I don't want to keep bothering you with this, but I couldn't deduce from
your response clearly whether you want me to document this feature or rip
it out or leave it in undocumented.

-Brett