mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
#7419: Fix a crash on Windows in locale.setlocale() when the category
is outside the allowed range.
This commit is contained in:
parent
7072f74dc8
commit
d728871ee1
3 changed files with 23 additions and 1 deletions
|
@ -360,6 +360,17 @@ class TestMiscellaneous(unittest.TestCase):
|
|||
# test crasher from bug #3303
|
||||
self.assertRaises(TypeError, locale.strcoll, u"a", None)
|
||||
|
||||
def test_setlocale_category(self):
|
||||
locale.setlocale(locale.LC_ALL)
|
||||
locale.setlocale(locale.LC_TIME)
|
||||
locale.setlocale(locale.LC_CTYPE)
|
||||
locale.setlocale(locale.LC_COLLATE)
|
||||
locale.setlocale(locale.LC_MONETARY)
|
||||
locale.setlocale(locale.LC_NUMERIC)
|
||||
|
||||
# crasher from bug #7419
|
||||
self.assertRaises(locale.Error, locale.setlocale, 12345)
|
||||
|
||||
|
||||
def test_main():
|
||||
tests = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue