[Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.26,
1.27
bcannon at users.sourceforge.net
bcannon at users.sourceforge.net
Wed Oct 6 04:12:09 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16270/Lib/test
Modified Files:
test_strptime.py
Log Message:
Locale data that contains regex metacharacters are now properly escaped.
Closes bug #1039270.
Index: test_strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- test_strptime.py 14 Jul 2004 00:43:51 -0000 1.26
+++ test_strptime.py 6 Oct 2004 02:11:36 -0000 1.27
@@ -176,6 +176,19 @@
found = compiled_re.match("\w+ 10")
self.failUnless(found, "Escaping failed of format '\w+ 10'")
+ def test_locale_data_w_regex_metacharacters(self):
+ # Check that if locale data contains regex metacharacters they are
+ # escaped properly.
+ # Discovered by bug #1039270 .
+ locale_time = _strptime.LocaleTime()
+ locale_time.timezone = (frozenset(("utc", "gmt",
+ "Tokyo (standard time)")),
+ frozenset("Tokyo (daylight time)"))
+ time_re = _strptime.TimeRE(locale_time)
+ self.failUnless(time_re.compile("%Z").match("Tokyo (standard time)"),
+ "locale data that contains regex metacharacters is not"
+ " properly escaped")
+
class StrptimeTests(unittest.TestCase):
"""Tests for _strptime.strptime."""
More information about the Python-checkins
mailing list