Re: strptime not strict enough

2009-12-20 Thread Tim Roberts
Chris Rebert wrote: >On Tue, Dec 15, 2009 at 9:47 PM, Tim Roberts wrote: >> Tobias Weber wrote: >>> >>>despite the directives for leading zero stime.strptime('09121', >>>'%y%m%d') returns the first of December. Shouldn't it raise ValueError? >> >> Python merely calls the strptime function in yo

Re: strptime not strict enough

2009-12-16 Thread Lie Ryan
On 12/15/2009 10:30 AM, Tobias Weber wrote: Hi, despite the directives for leading zero stime.strptime('09121', '%y%m%d') returns the first of December. Shouldn't it raise ValueError? Where do I get strict date parsing? A bit hackish perhaps, but maybe you can check for the date's length: dat

Re: strptime not strict enough

2009-12-15 Thread Chris Rebert
On Tue, Dec 15, 2009 at 9:47 PM, Tim Roberts wrote: > Tobias Weber wrote: >> >>despite the directives for leading zero stime.strptime('09121', >>'%y%m%d') returns the first of December. Shouldn't it raise ValueError? > > Python merely calls the strptime function in your C run-time library.  If >

Re: strptime not strict enough

2009-12-15 Thread Tim Roberts
Tobias Weber wrote: > >despite the directives for leading zero stime.strptime('09121', >'%y%m%d') returns the first of December. Shouldn't it raise ValueError? Python merely calls the strptime function in your C run-time library. If it sucks, so will time.strptime. >Where do I get strict date