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
3b04ce82
Kaydet (Commit)
3b04ce82
authored
Haz 28, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch from Mark Hammond to fix a test error.
Now runs without exception on WinME/98.
üst
19699a93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
test_unicode_file.py
Lib/test/test_unicode_file.py
+12
-9
No files found.
Lib/test/test_unicode_file.py
Dosyayı görüntüle @
3b04ce82
...
@@ -39,17 +39,20 @@ class TestUnicodeFiles(unittest.TestCase):
...
@@ -39,17 +39,20 @@ class TestUnicodeFiles(unittest.TestCase):
os
.
path
.
abspath
(
filename
)
==
os
.
path
.
abspath
(
glob
.
glob
(
filename
)[
0
]))
os
.
path
.
abspath
(
filename
)
==
os
.
path
.
abspath
(
glob
.
glob
(
filename
)[
0
]))
# basename should appear in listdir.
# basename should appear in listdir.
path
,
base
=
os
.
path
.
split
(
os
.
path
.
abspath
(
filename
))
path
,
base
=
os
.
path
.
split
(
os
.
path
.
abspath
(
filename
))
if
(
isinstance
(
filename
,
str
)):
if
isinstance
(
base
,
str
):
new_base
=
base
.
decode
(
TESTFN_ENCODING
)
base
=
base
.
decode
(
TESTFN_ENCODING
)
file_list
=
[
f
.
decode
(
TESTFN_ENCODING
)
for
f
in
os
.
listdir
(
path
)]
file_list
=
os
.
listdir
(
path
)
else
:
# listdir() with a unicode arg may or may not return Unicode
new_base
=
base
# objects, depending on the platform.
file_list
=
os
.
listdir
(
path
)
if
file_list
and
isinstance
(
file_list
[
0
],
str
):
file_list
=
[
f
.
decode
(
TESTFN_ENCODING
)
for
f
in
file_list
]
new_base
=
unicodedata
.
normalize
(
"NFD"
,
new_base
)
# Normalize the unicode strings, as round-tripping the name via the OS
# may return a different (but equivalent) value.
base
=
unicodedata
.
normalize
(
"NFD"
,
base
)
file_list
=
[
unicodedata
.
normalize
(
"NFD"
,
f
)
for
f
in
file_list
]
file_list
=
[
unicodedata
.
normalize
(
"NFD"
,
f
)
for
f
in
file_list
]
self
.
failUnless
(
new_
base
in
file_list
)
self
.
failUnless
(
base
in
file_list
)
# Do as many "equivalancy' tests as we can - ie, check that although we
# Do as many "equivalancy' tests as we can - ie, check that although we
# have different types for the filename, they refer to the same file.
# have different types for the filename, they refer to the same file.
...
...
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