diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 00:27:04 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-24 00:27:04 (GMT) |
commit | cf9d3c08c85e659a322d24467fc972959e326c9a (patch) | |
tree | e1faa4c123870921ec03fcbe14811f449c143845 /Lib/test | |
parent | 216a3bc36d31df71544fd9a11b98fca4efeb8182 (diff) | |
download | cpython-cf9d3c08c85e659a322d24467fc972959e326c9a.zip cpython-cf9d3c08c85e659a322d24467fc972959e326c9a.tar.gz cpython-cf9d3c08c85e659a322d24467fc972959e326c9a.tar.bz2 |
Issue #1813: Fix codec lookup under Turkish locales.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_codecs.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 6c7d44b..6b84023 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -1,6 +1,7 @@ from test import support import unittest import codecs +import locale import sys, _testcapi, io class Queue(object): @@ -1230,6 +1231,19 @@ class CodecsModuleTest(unittest.TestCase): self.assertRaises(TypeError, codecs.getwriter) self.assertRaises(LookupError, codecs.getwriter, "__spam__") + def test_lookup_issue1813(self): + # Issue #1813: under Turkish locales, lookup of some codecs failed + # because 'I' is lowercased as "ı" (dotless i) + oldlocale = locale.getlocale(locale.LC_CTYPE) + 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') + c = codecs.lookup('ASCII') + self.assertEqual(c.name, 'ascii') + class StreamReaderTest(unittest.TestCase): def setUp(self): |