diff options
| author | Brett Cannon <bcannon@gmail.com> | 2007-06-03 23:13:41 (GMT) |
|---|---|---|
| committer | Brett Cannon <bcannon@gmail.com> | 2007-06-03 23:13:41 (GMT) |
| commit | f7188cefb31371394201ec7f1fd321936f5b37a1 (patch) | |
| tree | 3868f9fb097070f6eb3f20bdb265b1cd92cdcb1b /Lib/_strptime.py | |
| parent | 994ebed50cb6dbdf96e63ed9f2c0697f2094f262 (diff) | |
| download | cpython-f7188cefb31371394201ec7f1fd321936f5b37a1.zip cpython-f7188cefb31371394201ec7f1fd321936f5b37a1.tar.gz cpython-f7188cefb31371394201ec7f1fd321936f5b37a1.tar.bz2 | |
Make _strptime.TimeRE().pattern() use ``\s+`` for matching whitespace instead
of ``\s*``. This prevents patterns from "stealing" bits from other patterns in
order to make a match work.
Closes bug #1730389. Will be backported.
Diffstat (limited to 'Lib/_strptime.py')
| -rw-r--r-- | Lib/_strptime.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py index 9e7823a..166cf82 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -250,7 +250,7 @@ class TimeRE(dict): regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") format = regex_chars.sub(r"\\\1", format) whitespace_replacement = re_compile('\s+') - format = whitespace_replacement.sub('\s*', format) + format = whitespace_replacement.sub('\s+', format) while '%' in format: directive_index = format.index('%')+1 processed_format = "%s%s%s" % (processed_format, |
