[Patches] [ python-Patches-670012 ] Compatibility changes for _strptime.py

SourceForge.net noreply@sourceforge.net
Fri, 17 Jan 2003 19:57:35 -0800


Patches item #670012, was opened at 2003-01-17 17:03
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=670012&group_id=5470

Category: Library (Lib)
>Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Brett Cannon (bcannon)
>Assigned to: Tim Peters (tim_one)
Summary: Compatibility changes for _strptime.py

Initial Comment:
This patch has a few compatibility changes so as to be a better drop-in replacement for the C version.  First, the 'y' directive now handles [00, 68] as a suffix for the 21st century while [69, 99] is treated as the suffix for the 20th century (this is for Open Group compatibility).  strptime now returns default values that make it a valid date (this is in response to Kevin Jacobs' discovery that default values of -1 might thow someone off if they use time.mktime(); thread on this can be found at http://mail.python.org/pipermail/python-dev/2003-January/031983.html).  Lastly, the ability to pass in a regex object to use instead of a format string (and the inverse ability to have strptime return a regex object) has been removed.  This is in preparation for a future patch that will add some caching internally to get a speed boost.

test_strptime.py has some tests added and removed.  Also did a minute amount of nit-picky changes.  Some of the changes should have gone in when _strptime.py hit 1.9 in CVS, but I forgot to include them in the patch; sorry about that.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2003-01-17 22:57

Message:
Logged In: YES 
user_id=31435

Thanks, Brett!  Checked in:

Lib/_strptime.py; new revision: 1.10
Lib/test/test_strptime.py; new revision: 1.9

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=670012&group_id=5470