diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 00:40:25 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 00:40:25 (GMT) |
commit | 0e3c5a828e65f4f5821dad0e7b0ff4ca9f62f9d3 (patch) | |
tree | c8fb2a3ffa9ad258565d900955cc16c4318af655 /Lib/test | |
parent | cf9d3c08c85e659a322d24467fc972959e326c9a (diff) | |
download | cpython-0e3c5a828e65f4f5821dad0e7b0ff4ca9f62f9d3.zip cpython-0e3c5a828e65f4f5821dad0e7b0ff4ca9f62f9d3.tar.gz cpython-0e3c5a828e65f4f5821dad0e7b0ff4ca9f62f9d3.tar.bz2 |
Add a test for issue #1813: getlocale() failing under a Turkish locale
(not a problem under 3.x)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_locale.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index e959343..5155923 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -391,6 +391,19 @@ class TestMiscellaneous(unittest.TestCase): # crasher from bug #7419 self.assertRaises(locale.Error, locale.setlocale, 12345) + def test_getsetlocale_issue1813(self): + # Issue #1813: setting and getting the locale under a Turkish locale + oldlocale = locale.getlocale() + self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale) + try: + locale.setlocale(locale.LC_CTYPE, 'tr_TR') + except locale.Error: + # Unsupported locale on this system + self.skipTest('test needs Turkish locale') + loc = locale.getlocale() + locale.setlocale(locale.LC_CTYPE, loc) + self.assertEqual(loc, locale.getlocale()) + def test_main(): tests = [ |