changeset: 71490:a77a4df54b95 branch: 3.2 user: Antoine Pitrou date: Sun Jul 24 02:40:25 2011 +0200 files: Lib/test/test_locale.py description: Add a test for issue #1813: getlocale() failing under a Turkish locale (not a problem under 3.x) diff -r 92d02de91cc9 -r a77a4df54b95 Lib/test/test_locale.py --- a/Lib/test/test_locale.py Sun Jul 24 02:27:04 2011 +0200 +++ b/Lib/test/test_locale.py Sun Jul 24 02:40:25 2011 +0200 @@ -391,6 +391,19 @@ # 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 = [