summaryrefslogtreecommitdiffstats
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2003-08-29 02:28:54 (GMT)
committerBrett Cannon <bcannon@gmail.com>2003-08-29 02:28:54 (GMT)
commit953c6f508b43bd7d4532aeb4644829122f80ae2a (patch)
tree05244772d60f8e4318ed78edc730199455d2f83c /Lib/_strptime.py
parent6676f6edc11bd3e3e1559a76aab22c6af6faf14e (diff)
downloadcpython-953c6f508b43bd7d4532aeb4644829122f80ae2a.zip
cpython-953c6f508b43bd7d4532aeb4644829122f80ae2a.tar.gz
cpython-953c6f508b43bd7d4532aeb4644829122f80ae2a.tar.bz2
Make sure parentheses are escaped when used in the format string.
Closes bug #796149 . Will be backported.
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r--Lib/_strptime.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 537296f..85db89d 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -249,7 +249,7 @@ class TimeRE(dict):
processed_format = ''
# The sub() call escapes all characters that might be misconstrued
# as regex syntax.
- regex_chars = re_compile(r"([\\.^$*+?{}\[\]|])")
+ regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
whitespace_replacement = re_compile('\s+')
format = whitespace_replacement.sub('\s*', format)