Kaydet (Commit) d980c920 authored tarafından Brett Cannon's avatar Brett Cannon

Escape locale data for regex metacharacters.

Closes bug #1039270.
üst 6b255fc1
......@@ -18,6 +18,7 @@ import locale
import calendar
from re import compile as re_compile
from re import IGNORECASE
from re import escape as re_escape
from datetime import date as datetime_date
__author__ = "Brett Cannon"
......@@ -367,7 +368,7 @@ class TimeRE(dict):
else:
return ''
to_convert.sort(sorter)
regex = '|'.join(to_convert)
regex = '|'.join([re_escape(stuff) for stuff in to_convert])
regex = '(?P<%s>%s' % (directive, regex)
return '%s)' % regex
......
......@@ -53,6 +53,8 @@ Extension modules
Library
-------
- Bug #1039270: Locale data is now escaped for regex metacharacters.
- Bug #807871: Fix tkMessageBox.askyesno result.
- Patch #1014992: In tarfile.readline, never return more than a line.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment