[Python-checkins] python/dist/src/Lib _strptime.py,1.6,1.7
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
2002年12月26日 08:19:54 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv2045/Lib
Modified Files:
_strptime.py
Log Message:
Fix julian day problem with strptime. Note: XXX about using 0, suggestions?
Index: _strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** _strptime.py 27 Nov 2002 08:30:25 -0000 1.6
--- _strptime.py 26 Dec 2002 16:19:52 -0000 1.7
***************
*** 307,310 ****
--- 307,312 ----
def __init__(self, locale_time=LocaleTime()):
"""Init inst with non-locale regexes and store LocaleTime object."""
+ # XXX: should 0 be valid for:
+ # day (d), julian day (j), month (m), and hour12 (I)?
super(TimeRE,self).__init__({
# The " \d" option is to make %c from ANSI C work
***************
*** 312,316 ****
'H': r"(?P<H>2[0-3]|[0-1]\d|\d)",
'I': r"(?P<I>0\d|1[0-2]|\d)",
! 'j': r"(?P<j>(?:3[0-5]\d|6[0-6])|[0-2]\d\d|\d)",
'm': r"(?P<m>0\d|1[0-2]|\d)",
'M': r"(?P<M>[0-5]\d|\d)",
--- 314,318 ----
'H': r"(?P<H>2[0-3]|[0-1]\d|\d)",
'I': r"(?P<I>0\d|1[0-2]|\d)",
! 'j': r"(?P<j>(?:3[0-5]\d|36[0-6])|[0-2]\d\d|\d\d|\d)",
'm': r"(?P<m>0\d|1[0-2]|\d)",
'M': r"(?P<M>[0-5]\d|\d)",