Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5a24d829
Kaydet (Commit)
5a24d829
authored
Tem 24, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Add a test for issue #1813: getlocale() failing under a Turkish locale
(not a problem under 3.x)
üst
8dbd8573
0e3c5a82
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
test_codecs.py
Lib/test/test_codecs.py
+14
-0
test_locale.py
Lib/test/test_locale.py
+13
-0
NEWS
Misc/NEWS
+2
-0
codecs.c
Python/codecs.c
+1
-1
No files found.
Lib/test/test_codecs.py
Dosyayı görüntüle @
5a24d829
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
):
...
...
Lib/test/test_locale.py
Dosyayı görüntüle @
5a24d829
...
...
@@ -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
=
[
...
...
Misc/NEWS
Dosyayı görüntüle @
5a24d829
...
...
@@ -237,6 +237,8 @@ Core and Builtins
Library
-------
- Issue #1813: Fix codec lookup under Turkish locales.
- Issue #12591: Improve support of "universal newlines" in the subprocess
module: the piped streams can now be properly read from or written to.
...
...
Python/codecs.c
Dosyayı görüntüle @
5a24d829
...
...
@@ -69,7 +69,7 @@ PyObject *normalizestring(const char *string)
if
(
ch
==
' '
)
ch
=
'-'
;
else
ch
=
tolower
(
Py_CHARMASK
(
ch
));
ch
=
Py_TOLOWER
(
Py_CHARMASK
(
ch
));
p
[
i
]
=
ch
;
}
p
[
i
]
=
'\0'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment