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
edfba824
Kaydet (Commit)
edfba824
authored
Agu 15, 2011
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
The simplest possible fix for the regression in bug 12752 by encoding unicodes
to 8-bit strings.
üst
5085e8ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
locale.py
Lib/locale.py
+2
-0
test_locale.py
Lib/test/test_locale.py
+5
-0
No files found.
Lib/locale.py
Dosyayı görüntüle @
edfba824
...
@@ -355,6 +355,8 @@ def normalize(localename):
...
@@ -355,6 +355,8 @@ def normalize(localename):
"""
"""
# Normalize the locale name and extract the encoding
# Normalize the locale name and extract the encoding
if
isinstance
(
localename
,
unicode
):
localename
=
localename
.
encode
(
'ascii'
)
fullname
=
localename
.
translate
(
_ascii_lower_map
)
fullname
=
localename
.
translate
(
_ascii_lower_map
)
if
':'
in
fullname
:
if
':'
in
fullname
:
# ':' is sometimes used as encoding delimiter.
# ':' is sometimes used as encoding delimiter.
...
...
Lib/test/test_locale.py
Dosyayı görüntüle @
edfba824
...
@@ -412,6 +412,11 @@ class TestMiscellaneous(unittest.TestCase):
...
@@ -412,6 +412,11 @@ class TestMiscellaneous(unittest.TestCase):
locale
.
setlocale
(
locale
.
LC_CTYPE
,
loc
)
locale
.
setlocale
(
locale
.
LC_CTYPE
,
loc
)
self
.
assertEqual
(
loc
,
locale
.
getlocale
())
self
.
assertEqual
(
loc
,
locale
.
getlocale
())
def
test_normalize_issue12752
(
self
):
# Issue #1813 caused a regression where locale.normalize() would no
# longer accept unicode strings.
self
.
assertEqual
(
locale
.
normalize
(
u'en_US'
),
'en_US.ISO8859-1'
)
def
test_main
():
def
test_main
():
tests
=
[
tests
=
[
...
...
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