[Patches] [ python-Patches-658820 ] regex fixes for _strptime
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 26 Dec 2002 14:41:39 -0800
Patches item #658820, was opened at 2002-12-26 14:41
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=658820&group_id=5470
Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brett Cannon (bcannon)
Assigned to: Nobody/Anonymous (nobody)
Summary: regex fixes for _strptime
Initial Comment:
Neal Norwitz discovered that the regex for the Julian
day would catch a value of 0, which is invalid. He
asked if this and two other values should allow 0.
The Python docs say no (according to what values the
time tuple should have), so I fixed the regexes that
should not catch 0 to not. I also cleaned the order
of some of them. I also made 'W' just use 'U' directly
instead of having it be done using a copy-n-paste in
the code.
One possible issue that I forsee is that 'Y' expects
exactly 4 digits for the year. Is this reasonable,
or should it be more like ``\d+?``? I don't know what
the valid range is, but since the docs specify that it
has the century digits, I figured it should be 4. But
what about when we pass the year 9999? If any
quantifier is put on to 'Y', it must be non-greedy;
otherwise something like ``20021226`` would not be
parsed as 2002-12-26 as it should be.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=658820&group_id=5470