diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 02:40:25 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 02:40:25 +0200 |
commit | 78681702e50e6028539d3a3658e401682d938f73 (patch) | |
tree | 1d084b14348f5c5a95e54457c085286904764216 /Lib/test/test_locale.py | |
parent | 13cbc8430c90032f5351afd156632336c59e9674 (diff) | |
download | cpython-78681702e50e6028539d3a3658e401682d938f73.tar.gz |
Add a test for issue #1813: getlocale() failing under a Turkish locale
(not a problem under 3.x)
Diffstat (limited to 'Lib/test/test_locale.py')
-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 e959343cca..5155923c91 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 = [ |